Search the Community
Showing results for tags 'variable'.
Found 4 results
If I sometimes work at line 494 in my script and want to create a new variable, i need to scroll to the top and then make a new one , then try to find the line 494 again, remember what I actually called the value (sometimes need to scroll up again ,ha) . I think one will know what I mean. What would be good Is a tool at the side of the script editor where you it generates values by selecting the data type, what its called and so on. Just a smaller change that I would add to all the changes that we await for the script editor.
Hi, How one will go about passing variables between maps? For eg. let's take Marble Game. When player reaches trigger to load another map, game map loads from start and you play again, your score is zeroed. What if you want to pass a highscore or some other vars so I can access them in the new map? Should I store those vars globally so they are accessible regardless of what map is loaded ? How do I go about it ? Thanks.
The thing is: how can I use a variable in one script stated on other script in lua? On example: I have 2 scripts: fps_gun.lua with a variable of ammo_count and a script App.lua with a variable named ammo_ammount. How can I use a ammo_count in App.lua(4example ammo_ammount=ammo_count) Thanks beforehand!
Hai! I have a function for changing the music track in my game and it works fine and all, but I also want it to get the total length of the track... Here is my function I'm currently using: function App:SwitchMusic(name) App.source:Stop() local sound = Sound:Load("Sound/BGM/" .. name .. ".wav") App.source:SetSound(sound) App.source:Play() end I tried adding something like App.tracklength = Math:Round(self.name:GetLength()) But it only returns in an error, since I guess it's trying to find a loaded sound with the name "name" and not from the variable. Do anyone have any idea how I can solve this? Thanks! KraXarN