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

Im trying to make a refreshing gui and it wont refresh??[CLOSED]

heres the code i dont know why it wont refresh

local RefreshTime = script.Parent.Refresh.Value

script.Parent.ClickDetector.MouseClick:Connect(function(player)
    local Textlabelforthingy = player.PlayerGui.ScreenGui.TextLabel
    Textlabelforthingy.Text = "the part has been clicked"
end)

local function RefreshText()
	local Textlabelforthingy = player.PlayerGui.ScreenGui.TextLabel
    Textlabelforthingy.Text = "."
end

while true do
	wait(RefreshTime)
	RefreshText()
end

6 comments

0

Are you using a localscript or a script?

0

i dont know

0

script

0

if you use a localscript it would be a lot easier then at the top of the localscript you can add local player = game.Players.LocalPlayer

1

Always use a LOCALSCRIPT for Gui's. Don't use server scripts as it will happen for the rest of the players.

0

Is this in StarterGui?

1 answer

✓ Accepted answer

Use a localscript insteed of a script then this will work.

local player = game.Players.LocalPlayer
local RefreshTime = script.Parent.Refresh.Value

script.Parent.ClickDetector.MouseClick:Connect(function()
    local Textlabelforthingy = player.PlayerGui.ScreenGui.TextLabel
    Textlabelforthingy.Text = "the part has been clicked"
end)

local function RefreshText()
    local Textlabelforthingy = player.PlayerGui.ScreenGui.TextLabel
    Textlabelforthingy.Text = "."
end

while true do
    wait(RefreshTime)
    RefreshText()
end

1 comment

1

thanks

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