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

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

Asked by 5 years ago
Edited 5 years ago

heres the code i dont know why it wont refresh

01local RefreshTime = script.Parent.Refresh.Value
02 
03script.Parent.ClickDetector.MouseClick:Connect(function(player)
04    local Textlabelforthingy = player.PlayerGui.ScreenGui.TextLabel
05    Textlabelforthingy.Text = "the part has been clicked"
06end)
07 
08local function RefreshText()
09    local Textlabelforthingy = player.PlayerGui.ScreenGui.TextLabel
10    Textlabelforthingy.Text = "."
11end
12 
13while true do
14    wait(RefreshTime)
15    RefreshText()
16end
0
Are you using a localscript or a script? DBoi941 57 — 5y
0
i dont know QuestionableScript3r -6 — 5y
0
script QuestionableScript3r -6 — 5y
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 DBoi941 57 — 5y
View all comments (2 more)
1
Always use a LOCALSCRIPT for Gui's. Don't use server scripts as it will happen for the rest of the players. youtubemasterWOW 2741 — 5y
0
Is this in StarterGui? DemonHunterz6 35 — 5y

1 answer

Log in to vote
1
Answered by
DBoi941 57
5 years ago

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

01local player = game.Players.LocalPlayer
02local RefreshTime = script.Parent.Refresh.Value
03 
04script.Parent.ClickDetector.MouseClick:Connect(function()
05    local Textlabelforthingy = player.PlayerGui.ScreenGui.TextLabel
06    Textlabelforthingy.Text = "the part has been clicked"
07end)
08 
09local function RefreshText()
10    local Textlabelforthingy = player.PlayerGui.ScreenGui.TextLabel
11    Textlabelforthingy.Text = "."
12end
13 
14while true do
15    wait(RefreshTime)
16    RefreshText()
17end
1
thanks QuestionableScript3r -6 — 5y
Ad

Answer this question