Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

2 comments

0

Are you using the ROBLOX Linked Leaderboard?

0

yes, i just used a script to do it.

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.