Unable to cast Vector3 (skateboard)

Hello Developers!

I’m having a problem with my Remote Script

It was supposed to spawn at where the script said to be destinated

Heres the RemoteScript (serverscriptservice)

local Remotes = game.ReplicatedStorage.Remotes

Remotes.SpawnSkateboard.OnServerEvent:Connect(function(wheretospawn)
	local NewSkateboard = game.ReplicatedStorage.Skateboard:Clone()
	NewSkateboard.Parent = workspace
	NewSkateboard:MoveTo(wheretospawn)
end)

And this is the script that is firing the remote (inside of a startergui button)

script.Parent.MouseButton1Click:Connect(function()
	game.ReplicatedStorage.Remotes.SpawnSkateboard:FireServer(game.Players.LocalPlayer.Character.HumanoidRootPart.Position)
end)

Any help is allowed! Thanks!

First parameter of OnServerEvent is always the Player Instance, change that to

--Server-Sided Script
local Remotes = game.ReplicatedStorage.Remotes

Remotes.SpawnSkateboard.OnServerEvent:Connect(function(PlayerInstance, wheretospawn)
	local NewSkateboard = game.ReplicatedStorage.Skateboard:Clone()
	NewSkateboard.Parent = workspace
	NewSkateboard:MoveTo(wheretospawn)
end)
1 Like

Oh! That actually worked, Thanks alot!