Hi,
I have script that shows the GUI if player touches it, but when im no more touching it and then touch it, it dont show the gui. I have no errors so i dont know how to fix it
Script inside the part:
local Players = game:GetService("Players")
script.Parent.Touched:Connect(function(hit)
local character = hit.Parent
local player = Players:GetPlayerFromCharacter(hit.Parent)
if not player then return end
character:FindFirstChild("Humanoid"):UnequipTools()
local hum = character:FindFirstChild("Humanoid")
hum.WalkSpeed = 0
hum.JumpPower = 0
player.PlayerGui.GUI.Enabled = false
game.ReplicatedStorage.Unequip:FireClient(player)
if not player.PlayerGui:FindFirstChild("MyGUI") then
game.ReplicatedStorage.MyGUI:Clone().Parent = player.PlayerGui
end
end)