You can write your topic however you want, but you need to answer these questions:
I am trying to add a variable to make it easier to modify the game teleports in my badge game hub.
However, the Teleport function does not work with the variable for some reason. Please view the images for more context.
Could you please tell me what to do to make it work? Thanks.
SCRIPT
function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
game:GetService("TeleportService"):Teleport(script.Parent.PlaceValue,player)
end
end
script.Parent.Touched:connect(onTouched)
Here is an image of the script and the variable.
Here is the error message.