so i tried making a script so that when you touch a specific block, a gui appears.(im new to scripting). I've tried a ton of stuff but it dosent seem to be working
local stand = game.Workspace.swordstand local player = game.Players.GetPlayers() wait(2) player.PlayerGui.ScreenGui.Kokirisword.Visible = false function onTouch(part) player.PlayerGui.ScreenGui.Kokirisword.Visible = true wait(4) player.PlayerGui.ScreenGui.Kokirisword.Visible = false end
stand.Touched:connect(onTouch)
Anyone know how to fix this?
thanks
Put this in the 'swordstand' part.
local part = script.Parent local debounce = true part.Touched:connect(function(hit) if game.Players:FindFirstChild(hit.Parent.Name) and Workspace:FindFirstChild(hit.Parent.Name).Humanoid and debounce then debounce = false local player = game.Players[hit.Parent.Name] player.PlayerGui.ScreenGui.Kokirisword.Visible = true wait(4) player.PlayerGui.ScreenGui.Kokirisword.Visible = false debounce = true end end)