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

Can I have some help on a buy access to use a teleporter please?

Asked by 5 years ago
Edited 5 years ago

I am trying to make a script that requires you to buy permanent access to a teleporter can you help me please?

This is my current code below:

function touch(hit)

if game.Players:findFirstChild(hit.Parent.Name) ~= nil then

player = game.Players[hit.Parent.Name]

local Teleport = "Entered_Candy_Land" --Put the name of the Part between the ""s.

if player.Lands.CandyLandBought.Value == false then

if player.PlayerGui:findFirstChild("BuyCandyLand") == nil then

local gui = script.BuyCandyLand:clone()

gui.Parent = player.PlayerGui

repeat

wait()

until (player.Character.Torso.Position - script.Parent.Position).magnitude > 75

gui:remove()

else

if player.Lands.CandyLandBought.Value == true then

print("Bought!")

if script.Parent.Locked == false and script.Parent.Parent:findFirstChild(Teleport).Locked == false then script.Parent.Locked = true script.Parent.Parent:findFirstChild(Teleport).Locked = true --Checks Debounce.

local Pos = script.Parent.Parent:findFirstChild(Teleport) --Gets the Part to teleport to.

hit.Parent:moveTo(Pos.Position) wait(1) script.Parent.Locked = false script.Parent.Parent:findFirstChild(Teleport).Locked = false end end --Takes you there and Ends the Function.

end

end

end

end

script.Parent.Touched:connect(touch)

0
Well, you can make it a gamepass and complete the transaction via MarketplaceService. DeceptiveCaster 3761 — 5y
0
No real way to do this bestrobloxerall -10 — 5y

Answer this question