bigkopa
|
  |
| Joined: 05 Mar 2015 |
| Total Posts: 448 |
|
|
| 21 Jul 2015 11:46 PM |
Whenever I play my game to test it out, a lot of my scripts are broken.
But when I go to build mode everything works just fine?
What do I have to do so that it works when someone actually plays the game |
|
|
| Report Abuse |
|
|
Funse
|
  |
| Joined: 11 Jun 2012 |
| Total Posts: 7887 |
|
|
| 21 Jul 2015 11:47 PM |
| turn off filtering enabled. |
|
|
| Report Abuse |
|
|
bigkopa
|
  |
| Joined: 05 Mar 2015 |
| Total Posts: 448 |
|
| |
|
bigkopa
|
  |
| Joined: 05 Mar 2015 |
| Total Posts: 448 |
|
|
| 21 Jul 2015 11:52 PM |
That's weird.. I turned it on and now it's working..
I don't understand this lol |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 21 Jul 2015 11:53 PM |
local scripts need something like local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:wait()
that or you're trying to do local only stuff in a regular script or vice versa |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 21 Jul 2015 11:54 PM |
| There's a small chance it will work without the code above, which is probably what you experienced after turning FE on. |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 21 Jul 2015 11:56 PM |
it's because in build mode, all of your game is ran on your computer, you're not connected to a server. all of your scripts run on the client.
therefore your scripts are bound to work 99.9% of the time because they are ran on the client (despite being a "server" script)
so in build/offline mode you could use game.Players.LocalPlayer in a serverscript
because that script is running on the client
and sometimes you need to use :WaitForChild() so your script yields for objects that you know will exist for sure |
|
|
| Report Abuse |
|
|
bigkopa
|
  |
| Joined: 05 Mar 2015 |
| Total Posts: 448 |
|
| |
|
|
| 22 Jul 2015 12:02 AM |
Just because the scripts are ran on the client doesn't mean they will practically function better. So that is wrong.
You see, build mode is composed of the debugging mode. You can modify script code, build and do all that.
When the ROBLOX game is ran, all the code is compiled and ran in protected mode, Rbx.lua is hereby more restricted and the game runs, it is complex to explain so i'll just make it simple: During the game, more limits are put on the scripts so they run more limited to the user, while in studio it is open completely.
You can practically run RobloxLocked code (not all of it) in the Studio Command Bar.
ʏᴏᴜ ᴛʜᴏᴜɢʜᴛ ʏᴏᴜ ᴄᴏᴜʟᴅ ᴅʀᴀɢ ᴍᴇ ᴛᴏ ᴛʜᴇ ʙᴏᴛᴛᴏᴍ ᴏғ ᴛʜᴇ ʟᴀᴋᴇ sᴏ ʏᴏᴜ ᴄᴏᴜʟᴅ ᴇᴀᴛ ᴍᴇ ʟᴀᴛᴇʀ... ᴡᴇʟʟ ɢᴜᴇss ᴡʜᴀᴛ ᴘᴜɴᴋ... ɪᴍ ᴀ ғɪsʜ... ᴡɪᴛʜ ʟᴇɢs |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 22 Jul 2015 12:03 AM |
"Just because the scripts are ran on the client doesn't mean they will practically function better. So that is wrong."
never said they would run better
i said they are more likely to work (excluding if you make a syntax error of course) if you do something stupid like using .LocalPlayer in a server script
|
|
|
| Report Abuse |
|
|
|
| 22 Jul 2015 12:05 AM |
In Studio they run faster/slower depending on the client, that is all. The code is the same, everything is the same.
Server Scripts in studio are ran in the computer, which opens further what you can do
ʏᴏᴜ ᴛʜᴏᴜɢʜᴛ ʏᴏᴜ ᴄᴏᴜʟᴅ ᴅʀᴀɢ ᴍᴇ ᴛᴏ ᴛʜᴇ ʙᴏᴛᴛᴏᴍ ᴏғ ᴛʜᴇ ʟᴀᴋᴇ sᴏ ʏᴏᴜ ᴄᴏᴜʟᴅ ᴇᴀᴛ ᴍᴇ ʟᴀᴛᴇʀ... ᴡᴇʟʟ ɢᴜᴇss ᴡʜᴀᴛ ᴘᴜɴᴋ... ɪᴍ ᴀ ғɪsʜ... ᴡɪᴛʜ ʟᴇɢs |
|
|
| Report Abuse |
|
|