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

I need help making a button that only will teleport you when you have a certain amount of points? [closed]

Asked by 6 years ago

can someone help with a script that will make it so when you have a certain amount of points on the leaderstats, you can teleport to a different area using a teleport button.

i have already made the leaderstat script and the teleport button, but i cant seem to make the button not allow you to teleport if you dont have a certain value

0
Are you using the ROBLOX Linked Leaderboard? User#23009 5 — 6y
0
yes, i just used a script to do it. Pr_ogram 17 — 6y

Closed as Not Constructive by User#19524

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

you could probably do

local player = game.Players.LocalPlayer

function onTouched(part)
 local h = part.Parent:findFirstChild("Humanoid")
 if (h ~=nil) then
    if player.leaderstats.Money.Value > 1 then
        h.Parent.Torso.CFrame = CFrame.new(Vector3.new(281, 30.6, -26)) --Type here the position you want to teleport to.

    end   
 end
end

script.Parent.Touched:connect(onTouched)


put that in a localscript in the teleport pad part and remove the old script

Ad