game.Workspace.alarm.Touched:Connect(function(touch) local alarm = false local gui = game.StarterGui.PoliceNoti local alarmevent = game.ReplicatedStorage.AlarmEvent if touch.Parent:FindFirstChild("Humanoid")and game.Workspace.alarmsound.IsPlaying == false then game.Workspace.alarmsound:Play() alarmevent:FireAllClients() gui.Enabled = true alarm = true if alarm == true then wait(16.89) game.Workspace.alarmsound.Volume = 0 gui.Enabled = false end end end)
i also have a 2 second wait built into the local script in the gui which reads as such
local text = script.Parent.TextLabel local alarmevent = game.ReplicatedStorage.AlarmEvent alarmevent.OnClientEvent:Connect(function() wait(2) text.AnchorPoint = Vector2.new(-1, 0) text:TweenPosition(UDim2.new(-0,5, 0, 0, 0), nil, nil, 5) end)
have tried multiple things but it hasnt worked. Everything other than the gui appearing works. No errors in the console nothing, it just refuses to appear
Okay i see a lot of scripter "Beginners" do this. so you're trying to set gui.Enabled
in StarterGui
which is NOT what the Player
sees on it screen. Basically everything in the Startergui
gets copied to the Players Player.PlayerGui
But you can't just change it directly from a normal script
You have to use a Localscript
because a normal one can't change any descants of the PlayerGui
but how does a LocalScript
know when it has to change it. You have to use RemoteEvents
i know you know how to do that