I made a simple script to make a Teleport pad Duplicate something in ServerStorage and put the duplicate in the workspace for the player to teleport to.
This is my script:
script.Parent.Touched:Connect(function(hit)
local ws = game.Workspace
local Clone = game.ServerStorage.Maps.GrassIsles:Clone()
Clone.Parent = ws
local h = game.Players:GetPlayerFromCharacter().HumanoidRootPart
You didn’t specify anything in GetPlayerFromCharacter, It’s better to get the character immediately using Hit.Parent. And you really need a debounce for this as it’ll do this multiple times in one go
I recommed this
local deb = false
script.Parent.Touched:Connect(function(hit)
local char = hit.Parent
local root = char:FindFirstChild("HumanoidRootPart")
if not root or deb then return end
deb = true
local Clone = game.ServerStorage.Maps.GrassIsles:Clone()
Clone.Parent = workspace
root.Position = Clone.Position
wait(1)
deb = false
end)
I probably will, since I’m making a Tower Defense game that will probably have some bugs. Next thing you know is I made a post about the Troop placing lol.