I am trying to make a button that, upon being clicked, will subtract GUI currency. However I can't say "game.Players.LocalPlayer.etc..." because "localPlayer" does not work in a normal script. Here is the code I have now:
script.Parent.MouseClick:Connect(function(plr)
if game.Workspace.Data.Buildingname.Value == ("ArcherHut") then
game.Workspace.ArcherHut:SetPrimaryPartCFrame(CFrame.new(-731.5, 6.5, -2676.5)) -- sets moedel cframe.
wait(0.1)
game.Players.LocalPlayer.PlayerGui.Money.TextLabel.Number.Value = game.Players.LocalPlayer.PlayerGui.Money.TextLabel.Number.Value - 50
end
end)

1 comment
replace line 5 with "plr.PlayerGui.Money.TextLabel.Number.Value -= 50"