I am currently trying to make it so that when the player clicks a GuiButton, it teleports them to another place.
Instead, no matter what I do, when I click on the button, even in a live server, it does nothing. When I do it in Studio, it simply says,“Unable to cast Instance to int64” in the Output.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
This is the code (local script) in the button:
local db = false
local lp = game.Players.LocalPlayer
script.Parent.Activated:Connect(function()
if db == false then
db = true
game.ReplicatedStorage.Teleport:FireServer(lp, lp, 6171073179)
end
wait(5)
db = false
end)
This is the server script in the RemoteEvent.
local TeleportService = game:GetService("TeleportService")
game.ReplicatedStorage.Teleport.OnServerEvent:Connect(function(plr, placeid)
TeleportService:Teleport(placeid, plr)
end)
Is there something wrong with either one of my scripts?