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

Shop Gui Not Working? Working in Studio Test mode but not in Player!

Asked by 7 years ago

Shop Gui Not Working? Working in Studio Test mode but not in Player! My Shop Gui ONLY works in studio, it displays properly in Player, but the script does not work, here is the main script on the button that alows it to work in studio, this script allows people to buy the weapon Freely,

BTW THIS IS A REGUALR SCRIPT LOCATED INSIDE OF THE BUTTON

script.Parent.Text=tostring(script.Parent.ItemName.Value)..": "..tonumber(script.Parent.Cost.Value).." "..tostring(script.Parent.Currency.Value)
script.Parent.MouseButton1Click:connect(function()
if script.Parent.Parent.Parent.Parent.Parent.Parent:findFirstChild("leaderstats") then
if script.Parent.Parent.Parent.Parent.Parent.Parent.leaderstats[script.Parent.Currency.Value].Value>=tonumber(script.Parent.Cost.Value) then
script.Parent.Parent.Parent.Parent.Parent.Parent.leaderstats[script.Parent.Currency.Value].Value=script.Parent.Parent.Parent.Parent.Parent.Parent.leaderstats[script.Parent.Currency.Value].Value-tonumber(script.Parent.Cost.Value)
game.Lighting[script.Parent.ItemName.Value]:Clone().Parent=script.Parent.Parent.Parent.Parent.Parent.Parent.Backpack
game.Lighting[script.Parent.ItemName.Value]:Clone().Parent=script.Parent.Parent.Parent.Parent.Parent.Parent.StarterGear
end
end
end)

Is this the problem? Should it be a local script? This script also has other string values like Currency,Cost, and Item Name! The weapons that this script gives to you is in Lighting! Help????

0
Also, one of the easier things to do, whenever you go to the test tab in studio, click on Start rather then play. This will open up a window for a player and a window for the server. This will show what the errors are if you ran the game live. xxxXMrsAwesomeXxxx 70 — 7y

2 answers

Log in to vote
1
Answered by
Klamman 220 Moderation Voter
7 years ago

When you're editing properties in GUIs, all code should go in a LocalScript. Most times when you're working with the client (GUIs, local parts or particles, etc.) you should use a LocalScript. Otherwise, when working on the server (making parts, moving things, teleporting players), you should use regular scripts. Hope this helps, feel free to ask any follow-up questions if this doesn't work.

Ad
Log in to vote
0
Answered by 7 years ago

That is rather unusual that it is working on Studio but not Player. Usually the other way around... But, yes, I would try what he said.

Answer this question