|
| 26 Jul 2017 11:31 AM |
I made a script in studio where the player buys a skin pack and then they can equip it, it works fine in studio but in the actual game it takes away the money but you can't equip the skins. Can someone explain the difference between studio and the server and how I might be able to resolve this?
Thanks |
|
|
| Report Abuse |
|
|
| |
|
|
| 26 Jul 2017 01:08 PM |
I used
local player = game.Players.LocalPlayer local leaderboard = player:WaitForChild("Money") local button = script.Parent local price = button:WaitForChild("Price") local pack = player:WaitForChild("BrownRabbit")
button.MouseButton1Click:connect(function() if leaderboard.Bounz.Value >= price.Value then if pack.Collection.Value == 0 then pack.Collection.Value = 1 if pack.Collection.Value == 1 then leaderboard.Bounz.Value = leaderboard.Bounz.Value - price.Value end end end end)
Which should mean that if the Collection value is 1 then it charges, but when I do it in game and not in studio it charges but the value is 0? This is a local script in the Button GUI
I aslo used
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild('Humanoid') then local player = hit.Parent.Name local value = game.Players:FindFirstChild(player) if value.BrownRabbit.Collection.Value == 1 then local m = script.Parent.Parent local p = hit.Parent p.Torso.BrickColor = m.Torso.BrickColor p.Nose.BrickColor = m.Nose.BrickColor p.EyeBall.BrickColor = m.EyeBall.BrickColor p.EyeBall2.BrickColor = m.EyeBall2.BrickColor p.EyeCentre.BrickColor = m.EyeCentre.BrickColor p.EyeCentre2.BrickColor = m.EyeCentre2.BrickColor p.InLeftEar.BrickColor = m.InLeftEar.BrickColor p.InRightEar.BrickColor = m.InRightEar.BrickColor p.LeftEar.BrickColor = m.LeftEar.BrickColor p.RightEar.BrickColor = m.RightEar.BrickColor p.LeftTooth.BrickColor = m.LeftTooth.BrickColor p.RightTooth.BrickColor = m.RightTooth.BrickColor p.Mouth.BrickColor = m.Mouth.BrickColor
else print("Hi") end end end)
to make the character change, but prints "Hi" which means that the Collection Value is 0. This is in a normal script in the workspace! |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2017 01:11 PM |
| testing in play solo makes the game run locally while testing in the server runs how it's supposed to be in the real game. |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2017 01:14 PM |
| So what should I do? Should I turn the workspace script into a local, but I think that wont work? Any suggestions? |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2017 01:36 PM |
| I just Local server tested and it is doing the same, but the second script is working because I manually set the Collection as one and it worked, so the fault is in the first script. But the problem is it takes money away which it should only do when the Collection is one so I do not understand, if it doesn't change it then why does it charge? |
|
|
| Report Abuse |
|
|
| |
|
| |
|