I want to make a script where if a player touches a certain block then a screen gui appears only for them. This is a script I've tried to make but it won't work since it's a local script:
player = game.Player.LocalPlayer script.Parent.Touched:connect(function(hit) game.StarterGui.ScreenGui.Enabled = true wait(5) game.StarterGui.ScreenGui.Enabled = false end
it's a pretty simple concept and I'm sure there's something better I could use and I would really appreciate if someone taught me what it is. :)
By your coding I am judging you're a beginner, here, fixed:
local player = game.Players.LocalPlayer workspace.Part.Touched:connect(function(hit) player.PlayerGui.ScreenGui.Enabled = true wait(5) player.PlayerGui.ScreenGui.Enabled = true end)
Put it in a LocalScript in StarterGui or StarterPack