I'm making a script where if a part is touched and the players level is atleast 20 then it will teleport but it's not working.
Here is my script.
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid') then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and player.leaderstats.Level.Value >= 20 then
hit.Parent.HumanoidRootPart.CFrame = CFrame.new(-397.206, -214.932, -16.744)
end
end
end)

2 comments
It's still not working. I think there might be a problem on roblox's side
I don't think so, it should work fine. check if your server side's leaderstats, and it should be a server script as well.