script.Parent.MouseButton1Click:connect(function() game.Players.LocalPlayer.CharacterAppearanceId = 149574052 local Pos = game.Players.LocalPlayer.Character:GetPrimaryPartCFrame() game.Players.LocalPlayer:LoadCharacter() game.Players.LocalPlayer.Character:SetPrimaryPartCFrame(Pos) if game.Players.LocalPlayer.Character:FindFirstChild("ForceField") then game.Players.LocalPlayer.Character["ForceField"]:Destroy() end end)
I want them to click a ImageButton and it puts them as the player id I choose then it respawns them, i got it working but only in studio and it said something about the back end server in output and dev console
First of all, make sure the script is in a LocalScript. Second of all, if you want to make the player respawn, then why don't you just kill the player? Third of all, you were setting the player PrimaryPartCFrame to where it is currently standing (I think). Fourth of all, I haven't test out the script below.
script.Parent.MouseButton1Click:connect(function() game.Players.LocalPlayer.CharacterAppearanceId = 149574052 game.Players.LocalPlayer:LoadCharacter() game.Players.LocalPlayer.Character:SetPrimaryPartCFrame(0, 1, 0) -- Origin of X, Y, Z (Well kinda) if game.Players.LocalPlayer.Character:FindFirstChild("ForceField") then game.Players.LocalPlayer.Character["ForceField"]:Destroy() end end)