generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Coding issues

Previous Thread :: Next Thread 
FactualTheory is not online. FactualTheory
Joined: 10 Sep 2013
Total Posts: 1365
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
FactualTheory is not online. FactualTheory
Joined: 10 Sep 2013
Total Posts: 1365
28 Jun 2015 07:07 AM
My test world sorry. (see beginning)
Report Abuse
rayk999 is not online. 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
FactualTheory is not online. FactualTheory
Joined: 10 Sep 2013
Total Posts: 1365
28 Jun 2015 07:16 AM
this isn't a local script.
Report Abuse
rayk999 is not online. 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 is not online. 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
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image