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

Im trying to make a teleport button, where only vip can teleport. Why wont this code work?

Script:

local id = 6867225
local mps = game:GetService("MarketplaceService")

script.Parent.ClickDetector.MouseClick:Connect(function(p)
    if mps:UserOwnsGamePassAsync(p.UserId, id) then
	local char = p:WaitForChild("Character") or p.CharacterAdded
	char.HumanoidRootPart.CFrame = CFrame.new(0, 50, 0)
    end
end)

1 answer

✓ Accepted answer

Character is not a child of player, try p.Character instead of p:WaitForChild("Character").

2 comments

0

Im waiting for the owner, to check if it works!

0

yeah, p.Character or p.CharacterAdded:Wait()

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