My mind is broken
The player used to teleport, now it just doesn’t…
What did I do wrong here?´
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local LocalPlayer = Players.LocalPlayer
local function tp()
local Character = LocalPlayer.Character
if Character then
local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
if HumanoidRootPart then
HumanoidRootPart.CFrame = workspace.PlayerNewPos.CFrame
HumanoidRootPart.CFrame = CFrame.lookAt(HumanoidRootPart.Position, workspace.PlayerNewDir.Position)
end
end
end
ReplicatedStorage.Events.Start.OnClientEvent:Connect(tp)
I’m still a newbie, so don’t be surprised if the answer is so simple
Here’s the thing if you wanna have a look FlappyBird.rbxl (85.3 KB)
--Naming convention: onX, X being the event name
local function onEnd(client, toReverse) -- original: onEnd(toReverse)
if toReverse == true then
Eend:FireClient(client, false) -- original: Eend:FireClient(false)
end
end
local function onStart(client, toReverse) -- original: onStart(toReverse)
if toReverse == true then
Estart:FireClient(client, false) -- original: Estart:FireClient(false)
end
end
--Connections!
Eend.OnServerEvent:Connect(onEnd)
Estart.OnServerEvent:Connect(onStart)
your code doesnt accound for the fact that remoteevents sent from the client to the server have a parameter for which player sent it.