local currentlevelvalue = game.Players.LocalPlayer.leaderstats.Level.Value
local pad = script.Parent
local teleportTo = workspace.level:FindFirstChild(currentlevelvalue)
pad.Touched:connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
local humanoidRoot = hit.Parent:FindFirstChild("HumanoidRootPart")
if humanoidRoot then
humanoidRoot.CFrame = teleportTo.CFrame
end
end
end)
I want to create a block that on contact teleports you to a certain brick depending on your leaderboard score for example if your Level leaderboard value was 3 you would get sent to the brick called Level3. I'm not sure how to do this. I'm fairly new to lua but this is what i have. Could someone help me fix this code so it can perform the task i want?

1 comment
Same Problem with a Player