its fixed i used my brain to fix it
COMMUNITY QUESTION
never-mind i actually fixed it! ?
1 answer
Issues
- You're trying to index
LocalPlayer, which does not exist in the server. You'd want to replacegame.Players.LocalPlayer. It's redundant due to the fact that you've already definedplayer, as it was given as the first parameter to the OnServerEvent event connection function. - RemoteEvents shouldn't be in Lighting, but rather ReplicatedStorage
- There's no such thing as
findFirstChild. ROBLOX uses PascalCase, not camelCase. It should beFindFirstChild - You should be using
HumanoidRootPartif you want R15 compatibility. - You're using the CFrame object constructor function incorrectly. In your case, there's no need to get involved with CFrames. You should just use Vector3
- It's a good practice to use the
WaitForChildandGetServicefunctions, instead of just indexing instances with the desired child.
Solution
local ToolEvent = game:GetService("ReplicatedStorage"):WaitForChild("ToolEvent")
ToolEvent.OnServerEvent:Connect(function(Player)
local character = player.Character
if character and character:FindFirstChild("HumanoidRootPart") then
character.HumanoidRootPart.Position = Vector3.new(-63.84, 18.95, 37.718)
end
end)
3 comments
0
Thanks for trying but still the same error :/
0
I need to get the fired event which means it needs to stay in sss but then i also need the char so idk howww
0
i fixed it by my self its fine
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
U cannot use local player in normal script (Also local script won't run on ServerScriptService)