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 4 years ago
Edited 4 years ago

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
0
Are you using a localscript or a script? DBoi941 57 — 4y
0
i dont know QuestionableScript3r -6 — 4y
0
script QuestionableScript3r -6 — 4y
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 — 4y
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 — 4y
0
Is this in StarterGui? DemonHunterz6 35 — 4y

1 answer

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

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
thanks QuestionableScript3r -6 — 4y
Ad

Answer this question