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 » Game Design
Home Search
 

Re: shop script only works in play solo mode

Previous Thread :: Next Thread 
zaniac10 is not online. zaniac10
Joined: 18 Aug 2009
Total Posts: 10000
11 Dec 2014 02:08 PM
wait(5)
local plr = game.Players.LocalPlayer
local b = script.Parent

b.MouseButton1Down:connect(function()
if plr:FindFirstChild("leaderstats") then
if plr.leaderstats.Money.Value >= 200 then print("Successfully bought item! ~zaniac10")
game.ServerStorage.FastSnowball:Clone().Parent = plr.Backpack
else print("Not enough cash for item! ~zaniac10")
end
end
end)

well?

no output except for "Successfuly bought item! ~zaniac10", and it doesn't give me the item (in online mode), and "Not enough cash for item! ~zaniac10"

~ zαηίας10 | https://www.youtube.com/watch?v=5u3iv8AT8G8
Report Abuse
GodShowsTheWay is not online. GodShowsTheWay
Joined: 27 Oct 2014
Total Posts: 7180
11 Dec 2014 02:22 PM
Is it in a local script?
Report Abuse
zaniac10 is not online. zaniac10
Joined: 18 Aug 2009
Total Posts: 10000
11 Dec 2014 02:23 PM
yes

~ zαηίας10 | https://www.youtube.com/watch?v=5u3iv8AT8G8
Report Abuse
robloxking240 is not online. robloxking240
Joined: 19 Aug 2010
Total Posts: 7049
11 Dec 2014 02:26 PM
Put the snowball in ReplicatedStorage instead of ServerStorage. Local scripts can't access ServerStorage.
Report Abuse
zaniac10 is not online. zaniac10
Joined: 18 Aug 2009
Total Posts: 10000
11 Dec 2014 02:28 PM
did not know that
i'll try it

~ zαηίας10 | https://www.youtube.com/watch?v=5u3iv8AT8G8
Report Abuse
GodShowsTheWay is not online. GodShowsTheWay
Joined: 27 Oct 2014
Total Posts: 7180
11 Dec 2014 02:29 PM
robloxking is right.

http://wiki.roblox.com/index.php?title=ServerStorage

"The advantage to storing objects server-side only is that network traffic will not be spent on transmitting these objects to players, which could be useful if, for instance, a place has several maps with a lot of parts that would otherwise all have to be downloaded by the client when the player joins a place, but only one is used at a time. The disadvantage is that LocalScripts will not be able to access the contents of this service."
Report Abuse
zaniac10 is not online. zaniac10
Joined: 18 Aug 2009
Total Posts: 10000
11 Dec 2014 02:40 PM
thanks soooo much!

wait(5)
local b = script.Parent
local plr = game.Players.LocalPlayer


b.MouseButton1Down:connect(function()
if plr:FindFirstChild("leaderstats") then
if plr.leaderstats.Money.Value >= 200 then print("Successfully bought item! ~zaniac10")
game.ReplicatedStorage.FastSnowball:Clone().Parent = plr.Backpack
else print("Not enough cash for item! ~zaniac10")
end
end
end)


it worked woot!

~ zαηίας10 | https://www.youtube.com/watch?v=5u3iv8AT8G8
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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