I’m working on this silly conclusion part, where at the end it’ll teleport players to a game of our choice. My code works fine until we get to the teleportation part. Here’s my script for teleportation:
Here’s the error:
Tried fixing, I have no idea how it works.
Any help is greatly appreciated.
If so, dont send the player in a Remote Event to the server, the type signature from your client is currently player, player, number
Instead, just send the place ID itself
conclusion:FireServer(1234567)
For future reference, if you’re dealing with a type error and want a good place to start, try getting it’s type using typeof, and if it’s an instance, you can also read its class name using Instance.ClassName
placeID is only set a value from the OnServerEvent event, this can only be fired from a LocalScript which means the error is in whatever local script is firing said event.
Here’s the local script code. I don’t personally see an issue but I’m also not a very adept programmer.
local button = script.Parent
local conclude = game:GetService('ReplicatedStorage'):WaitForChild('Conclusion')
button.MouseButton1Up:Connect(function()
if game.Players.LocalPlayer.Name == 'xynxae' or 'You_needHelp911' then-- testing
conclude:FireServer(game.Players.LocalPlayer, 10419359084)
else
game.Players.LocalPlayer:Kick('NOT AUTHORISED')
end
end)