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

I made a script and it doesnt do anything can someone tell me what did i do wrong? [closed]

Asked by 6 years ago

I tried to make a script on my own kinda but it obviously didnt work. Can someone please tell me what i did wrong? wait(0.5) local plr = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent local function GetLeaderboard( plr, ScoreName ) return plr:WaitForChild("leaderstats"):WaitForChild(ScoreName) end cost = 400 deb = 0

function onClick() wait(0.5) if game.ReplicatedStorage:FindFirstChild(plr.Name.."Element").Value == "Lava" then script.Parent.Text = "You already have this Arc" wait(1) script.Parent.Text = "Lava" else local Points = GetLeaderboard(plr, Points) if Points.Value >= cost then Points.Value = Points.Value - cost if deb == 0 then deb = 1 game.ReplicatedStorage:FindFirstChild(plr.Name.."Element").Value = "Lava" --Alter what stat you would like to increase or decrease after the player has purchased. plr:LoadCharacter() wait(1) deb = 0 end end end end script.Parent.MouseButton1Click:connect(onClick)

Closed as Non-Descriptive by evaera

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?