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

Can anyone help me with this job script for some reason it shows a error on leaderstats?

Asked by
0Hv1 0
3 years ago

Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).

the job script is not working for some reason someone help pls

local player = game.Players:GetPlayers()

local Jobbing = false

function onClicked(playerWhoClicked)if Jobbing == false then Jobbing = true playerWhoClicked.Character.LowerTorso.Anchored = true playerWhoClicked.Character.Head.Title.F.Working.Visible = true wait(5) playerWhoClicked.Character.LowerTorso.Anchored = false playerWhoClicked.readerstats.Wallet.Value=playerWhoClicked.readerstats.Wallet.Value+95; playerWhoClicked.Character.Head.Title.F.Working.Visible = true playerWhoClicked.Character.Head.Title.F.HowMuch.Visible = true wait(1) playerWhoClicked.Character.Head.Title.F.HowMuch.Visible = false Jobbing = false end end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

0
Put the code between the codeblock (lua button) and also `:connect` is deprecated use `:Connect` instead VerdommeMan 1479 — 3y
0
Also what error does it show and which line errors VerdommeMan 1479 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

lua script.Parent.ClickDetector.MouseClick:connect(onClicked) :connect is maybe wrong, change it to :Connect. And what error do you have in the output? If you don't have any error in the output try adding print() after every function to see which works and which don't works. If you have an error in the output try to fix it and it will work.

Ad

Answer this question