Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Teleporter that requires a stat to go through wont work?. Please help.

Asked by 1 year ago
Edited 1 year ago

I've been trying to find the problem for this script for a while now and I cant seem to fix it. The script requires a certain amount of stats to go through and get teleported to the area but it just wont work.

Here it is:

script.Parent.Touched:Connect(function(hit)
    local human = hit.Parent:FindFirstChild("Humanoid")
    if human ~= nil then
        local plr = game.Players:GetPlayerFromCharacter(hit.Parent)

        if plr.leaderstats.Teleport.Value >= 650 then
            hit.Parent:MoveTo(script.Parent.Parent.Spawn1.Position)
        end
    end
end)

Answer this question