Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

{Please Help!} Why is this script working in Studio Mode, but not in Player Mode?

Asked by 6 years ago
Edited 6 years ago

This is getting a little aggravating I am trying to make this script work, but it works in studio mode and not in player mode and I don't know why! My output is saying nothing is wrong with the script!

Where they are: --Price and Wait are IntValues in the Potato Script. --Main script is in Soil --Potato script is in Soil

In the chopping the crop down script I have the enable script. Why is this not working :(

script:


local Cash = game.Players.LocalPlayer.leaderstats.Cash local Price = script.Price.Value local carrot = script.Parent.Parent.Carrot local corn = script.Parent.Parent.Corn local wheat = script.Parent.Parent.Wheat local potato = script.Parent.Parent.Potato local pumpkin = script.Parent.Parent.Pumpkin local Let = script.Parent.Parent.Lettuce local On = script.Parent.Parent.Onion local Rice = script.Parent.Parent.Rice local PA = script.Parent.Parent.PotatoA local PB = script.Parent.Parent.PotatoB local PC = script.Parent.Parent.PotatoC potato.Touched:Connect(function(TouchedA) if Cash.Value >= Price then Cash.Value = Cash.Value - Price script.Disabled = true script.Parent.Main.Disabled = true script.Parent.Wheat.Disabled = true script.Parent.Corn.Disabled = true Let.Transparency = 1; On.Transparency = 1; Rice.Transparency = 1; carrot.Transparency = 1; corn.Transparency = 1; wheat.Transparency = 1; potato.Transparency = 1;pumpkin.Transparency = 1 Rice.SurfaceGui.Enabled = false; On.SurfaceGui.Enabled = false; Let.SurfaceGui.Enabled = false; pumpkin.SurfaceGui.Enabled = false; carrot.SurfaceGui.Enabled = false; corn.SurfaceGui.Enabled = false; wheat.SurfaceGui.Enabled = false; potato.SurfaceGui.Enabled = false; wait(1) PA.Transparency = 0 wait(5) PA.Transparency = 1 PB.Transparency = 0 wait(5) PB.Transparency = 1 PC.Transparency = 0 PC.Collect.Disabled = false script.Disabled = true elseif Cash.Value <= Price then script.Parent.Main.Disabled = false script.Parent.Corn.Disabled = false script.Parent.Wheat.Disabled = false PC.Collect.Disabled = true script.Disabled = false Cash.Value = Cash.Value - 0 end end)
0
is this in a local script? Worthy0ne 68 — 6y
0
Is your game filtering enabled? Asceylos 562 — 6y
0
neither of them worked Goldenkings11 -11 — 6y
0
If you actually test it out in Roblox Studio by creating a test server, then it should give you a few errors. Make sure that the "Server" checkbox is checked, then press the "Start" button under the "Test" tab. cfiredog 274 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Your problem is that you use LocalPlayer well that's the problem... It works only in StudioMode but if you go in Online Mode it wont work....

0
See if that work? AswormeDorijan111 531 — 6y
0
That will work, because Roblox Studio cannot read your mind on what you want to happen. It just follows the code that it been instructed to do. hiimgoodpack 2009 — 6y
0
what do I use instead of localplayer for that specific player? Goldenkings11 -11 — 6y
Ad

Answer this question