Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Change a Players Gui?

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)

1 comment

0

Oh yeah, and their job Gui must be Cashier.

1 answer

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

1 comment

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.