I have been looking on many tutorials online since i'm kinda new to Lua and none of the codes presented has worked for me, i found a promising one but when i gave it a try it didn't work
Here's the code:
game.Players.PlayerAdded:Connect(function(plr) script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then plr.PlayerGui.questchat.Teleport.Visible = false wait(2) plr.PlayerGui.questchat.Teleport.Visible = true end end) end)?
At first i thought it was a problem with the names of the GUI and frames but everything checks out and still no output, no change of properties and no popup or closure of the GUI
local Players = game:GetService('Players') script.Parent.Touched:connect(function (hit) if hit.Parent:FindFirstChild('Humanoid') then local char = hit.Parent if Players:FindFirstChild(char.Name) then local plr = Players:FindFirstChild(char.Name) plr.PlayerGui.questchat.Teleport.Visible = false wait(2) plr.PlayerGui.questchat.Teleport.Visible = true end end end) -- Didn't test but that should be right
Hello. This script will only work without filtering enabled.
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then --checks if it is a player local char = hit.Parent --gets the character local plr = hit.Parent::GetPlayerFromCharacter(char) --gets the player who touched the part plr.PlayerGui.questchat.Teleport.Visible = true --Sets the gui visible end end)