Reputation: 1
I made a teleportation script yesterday, tested it, and then went to sleep, now it doesn't work and it simply outputs the message "Script 'Workspace.first.Script', Line 11" and "Cfrane is not a valid member of Model "Workspace.davidechko". Is it possible I broke it somehow?
1 second=game.Workspace.second
2 hit = script.Parent.Touched:Connect(function(hit)
3 local player = game.Players:GetPlayerFromCharacter(hit.Parent)
4 if player then
5 local travelling = player.Character:FindFirstChild("travelling")
6 if not travelling then return end
7
8
9 if travelling.Value == false then
10 travelling.Value = true
11 player.Character.HumanoidRootPart.Cframe = second.CFrame + Vector3.new (0,5,0)
12 task.wait(3)
13 travelling.Value = false
14 end
15 end
16 end)
is it possible I changed something that broke it?
I tried changing it around a little but it still didn't work
Upvotes: 0
Views: 76
Reputation: 13
you did "Cframe" not "CFrame"
local second = game.Workspace.second
script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
local travelling = player.Character:FindFirstChild("travelling")
if not travelling then return end
if travelling.Value == false then
travelling.Value = true
player.Character.HumanoidRootPart.CFrame = second.CFrame + Vector3.new(0,5,0)
task.wait(3)
travelling.Value = false
end
end
end)
Upvotes: 0