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

Change a Players Gui?

Asked by 9 years ago

Yeah so I have tried to make a script where as long as the player as standing on a brick every 5 seconds their Money Gui goes up by 10. But the problem is well, I am not sure thats the problem. For whatever reason it just doesn't do anything. What am I doing wrong here?

local player = game.Players.LocalPlayer
local paybrick = script.Parent
local MoneyGui = game.Players.LocalPlayer.MoneyGui


function payperson(player)
    repeat
    if player.PlayerGui.Job.Jobname.Text == "Cashier" then 
        MoneyGui.Value = 0 + 10 
        wait(7)
    else
        end
    until(player.touched == false)
    end

script.Parent.touched:connect(payperson)

0
Oh yeah, and their job Gui must be Cashier. CrispyBrix 113 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

I am pretty sure the problem is:

local MoneyGui = game.Players.LocalPlayer.MoneyGui

The GUI would be in the players Player Gui So replace that line with:

local MoneyGui = game.Players.LocalPlayer.PlayerGui.MoneyGui
0
Nope, it says tried to index "LocalPlayeR" a nil value. so I assume it doesn;t know what a LocalPlayer is but I am not sure how to find the player stepping on the brick. CrispyBrix 113 — 9y
Ad

Answer this question