Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[ SOLVED ] Why won't player walk to point after a remote event is fired?

So, in my game, after a remote event fires, I want your character to walk to a part. The problem is, the character doesn't. I did the "game.ReplicatedStorage.TheNextTalk:FireServer()" in a normal script and local script, but something tells me that it's the walking script. Walking script (Local script):

local player = game.Players.LocalPlayer
character = player.Character
humanoid = character:WaitForChild("Humanoid")

local model = workspace.Parts
start = model.StarterPoint
endpoint = model.EndPoint
turn = model.Turn

-- 


	start.Touched:Connect(function()
	game.ReplicatedStorage.TheNextTalk.OnServerEvent:Connect(function(plr)
	wait(2)
	humanoid.TargetPoint = turn.Position
	humanoid.WalkToPoint = turn.Position
	wait(2)
	humanoid.TargetPoint = endpoint.Position
		humanoid.WalkToPoint = endpoint.Position
		end)
end)
	

The firing script (Local):

script.Parent.MouseButton1Click:Connect(function()

	local Camera = game.Workspace.CurrentCamera
local Player = game.Players.LocalPlayer

-- Camera --
repeat wait() until Player.Character
Camera.CameraType = "Scriptable"
Camera.CFrame = game.Workspace.Cutscene5.CFrame

local character = game.Players.LocalPlayer.Character
	
	game.ReplicatedStorage.TheNextTalk:FireServer()
	script.Parent.Parent.Parent.Enabled = false
	script.Parent.Parent.Visible = false
	
end)

I also removed the touched but it didn't work. So, please help! Thank you!

2 comments

0

Put a print statement under OnServerEvent and see if it prints. Also, you can't use FireServer() from the client (LocalScript.) https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events

0

@ItzFoxz, thank you!

1 answer

I think you can only use :FireServer() from a LocalScript. I can't see the other script so that's the only idea I have. Do any of the scripts give any errors?

1 comment

1

Hi, thanks for replying. None of the scripts give errors.

This discussion is preserved as it was. New answers, comments, and votes are closed.