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

My script refuses to change GUI text how to fix?

Asked by
ym5a 52
2 years ago
local sign = game.Lighting:FindFirstChild("SING")
local houso = game.Lighting:FindFirstChild("door")
local tnt = game.Lighting:FindFirstChild("dynamite")
local towa = game.Lighting:FindFirstChild("tower")

wait(5)
among:Clone().Parent = workspace
me:Clone().Parent = workspace
sign:Clone().Parent = workspace
houso:Clone().Parent = workspace
tnt:Clone().Parent = workspace
towa:Clone().Parent = workspace
print("cloned")
local scrips = game.ServerScriptService.lava:GetChildren()
for i,v in pairs(scrips) do
    v.Disabled = false
end
--game.StarterGui.ScreenGui.TextLabel.Text = "Lava will rise"

print("enabled")
wait(60)
-------------------------------------------------------
local amon1 = game.Workspace:FindFirstChild("Ambrogus")
local m1 = game.Workspace:FindFirstChild("hi")
local sig1 = game.Workspace:FindFirstChild("SING")
local hous1 = game.Workspace:FindFirstChild("door")
local tn1 = game.Workspace:FindFirstChild("dynamite")
local tow1 = game.Workspace:FindFirstChild("tower")
-------------------------------------------------------
amon1:remove()
m1:remove()
hous1:remove()
tn1:remove()
tow1:remove()
print("removed")
for i,v in pairs(scrips) do
    v.Disabled = true
end
--game.StarterGui.ScreenGui.TextLabel.Text = "I will tell you what will happen"
print("disabled")

The comments I put are the lines to focus on. Solutions i have tried: RemoteEvents If BoolValue == true statements Just doing it from the actual script

This is NOT a localscript and the location of this script is in a folder in ServerScriptService

1 answer

Log in to vote
1
Answered by 2 years ago

It doesn't work because you are trying to call StarterGui and GUIs can only be edited via a LocalScript. StarterGui replicates to the LocalPlayer. If you want to call your GUI via a server script you must do:

game.Players.PlayerAdded:Connect(function(player) 
player.PlayerGui.(GUI NAME AND THINGS HERE) 
end) 

0
I want this to happen if the lava is rising, I want it to tell you what "disaster" will or is happening, and I want to end right when the disaster is over, how would I do this? would I use a boolvalue? ym5a 52 — 2y
0
Nvm I figured it out thanks for this block though it helped ym5a 52 — 2y
Ad

Answer this question