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
 

This script works in studio, but not in-game.

Previous Thread :: Next Thread 
FallenTacoz is not online. FallenTacoz
Joined: 05 Aug 2013
Total Posts: 328
23 Apr 2016 12:09 PM
This problem happens waaaay more than it should in almost every game I create, and it's insanely annoying. Usually I can fix it with a localscript, but I tried that this time and it didn't work. Anyway, the title is self-explanatory. I will just paste the script here. Help is greatly appreciated! Thank you.

script.Parent.MouseClick:connect(function(player)
local plr = game.Players:FindFirstChild(player.Name)
if plr then
game.ServerStorage.Sushi["California Roll"]:Clone().Parent = plr.Backpack
end
end)


FallenTacoz
Report Abuse
FallenTacoz is not online. FallenTacoz
Joined: 05 Aug 2013
Total Posts: 328
23 Apr 2016 12:16 PM
Bump


FallenTacoz
Report Abuse
Uzil is not online. Uzil
Joined: 02 Jun 2014
Total Posts: 366
23 Apr 2016 12:34 PM
I used to have the same problem.


repeat wait() until game.Players.LocalPlayer

script.Parent.MouseClick:connect(function(player)
local plr = game.Players.LocalPlayer
if plr then
game.ServerStorage.Sushi["California Roll"]:Clone().Parent = plr.Backpack
end
end)
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
23 Apr 2016 12:49 PM
should be a server script

script.Parent.ClickDetector.MouseClick:connect(function(player)
game.ServerStorage.Sushi["California Roll"]:Clone().Parent = player.Backpack
end)


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