ok so I’ve been wanting to learn more scripting and I came across this code that I thought could be useful in my game a lot of people said it had worked but it hasn’t worked for me for some reason
local CurrentLocation = script.Parent
local Destination = game.Workspace.Part2
-- (Optional), You can create local variable for each part.
CurrentLocation.Touched:Connect(function(Touch)-- Touched function.
if Touch.Parent:FindFirstChild("HumanoidRootPart") then
-- Checks if the touched part parent contains 'HumanoidRootPart'
-- and if it does then this line of code will run.
Touch.Parent:FindFirstChild("HumanoidRootPart").CFrame = Destination.CFrame + Vector3.new(0,3,0)
-- This teleports the player to the destination.
end
end
I then changed it to this basically the same thing but I changed the local destination
local CurrentLocation = script.Parent
local Destination = game.Workspace.Teleporters.easy1
-- (Optional), You can create local variable for each part.
CurrentLocation.Touched:Connect(function(Touch)-- Touched function.
if Touch.Parent:FindFirstChild("HumanoidRootPart") then
-- Checks if the touched part parent contains 'HumanoidRootPart'
-- and if it does then this line of code will run.
Touch.Parent:FindFirstChild("HumanoidRootPart").CFrame = Destination.CFrame + Vector3.new(0,3,0)
-- This teleports the player to the destination.
end
end
The error occurs at the “end, end” part which I don’t know how to fix