Teleport Unable to cast Instance to Int64

Hi, developers!

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:
image

Here’s the error:
image

Tried fixing, I have no idea how it works.
Any help is greatly appreciated.

1 Like

The only property in Teleport that takes a int64 is the Place ID parmeter. Has placeID been changed to an instance anywhere in your code?

The error is Luau being unable to convert an instance to a number, so try starting on that


all of my messy code. as far as im concerned, nope.

Are you doing this from a LocalScript?

conclusion:FireServer(LocalPlayer, 1234567)

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

1 Like

The code I sent is from a server script, which is then activated via local script

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)

Like @metatablecatmaid said, do not send the player

conclude:FireServer(10419359084)
1 Like

What I said is happening is happening

So just completely remove the player from the FireServer function?

yes

the devforum needs a yes emote lol

ah. for some reason, i completely skipped over the “remove the player” from your previous message when reading it :sob: looks like that fixed it

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.