|
| 28 Jun 2015 07:06 AM |
My test work in roblox studio loves my code, it works really smoothly.
but, when it comes to real roblox it stops at "Begin"
heres the code
game.Workspace.Sound1:Play() h.Text = "BEGIN" wait(1) --Giving players weapons local weapons = game.ServerStorage:GetChildren() local chosenwep = weapons[math.random(1, #weapons)]:clone() chosenwep.Parent = game.Players.LocalPlayer.Backpack
note the top bit needs to stay, its vital. I think its the second section thats wrong. Correct me if otherwise. |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2015 07:07 AM |
| My test world sorry. (see beginning) |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 28 Jun 2015 07:15 AM |
i see that this is a localscript i see that you are trying to access serverstorage
please figure it out |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2015 07:16 AM |
| this isn't a local script. |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 28 Jun 2015 07:17 AM |
i see that this is a server script i see that you are trying to get the localplayer |
|
|
| Report Abuse |
|
|
DevJackB
|
  |
| Joined: 16 Apr 2015 |
| Total Posts: 44 |
|
|
| 28 Jun 2015 07:20 AM |
It needs to be a server script to get the LocalPlayer. Move the weapons to ReplicatedStorage.
"Lord have mercy on us. All people before me take warning by me." ~ John Amy Bell |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2015 07:51 AM |
:It needs to be a server script to get the LocalPlayer. Move the weapons to ReplicatedStorage."
It needs to be a localscript. You can't get the LocalPlayer without a localscript.
@OP Anyways... knowing this.. you need to make sure the script runs in a child of the Player or the Player's Character.
There is an important thing you have to watch out for.
AnyDirectory:WaitForChild("Part") is a must to use for waiting. Local scripts run before A LOT of things are loaded. |
|
|
| Report Abuse |
|
|