I have put in a teleportation script in my game where you click the GUI and you teleport to a part. But the thing is, I also want the GUI (or Script) to take away the gear that the player has so they can't harm players (It is an AFK Lobby in a murder game. You teleport to the Lobby so that you can't get killed if your AFK, but I don't know how to make it so it takes gear away).
COMMUNITY QUESTION
How to take away gear when you click teleportation GUI?
2 answers
All you have to do is put this at the end of the script
player = script.Parent.Parent.Parent.Parent.Parent.Parent
db = false
function Click(mouse)
if not db then
db = true
local human = player.Character:FindFirstChild("Humanoid")
if human then
human:UnequipTools()
end
jok=player.Backpack
jok:Remove()
end
end
script.Parent.MouseButton1Down:connect(Click)
I am not sure but i think this could work
local player = game.Players.LocalPlayer
Active = true -- Change to "true"/"false" to activate/deactivate script
function Clicked()
if Active = true then do -- Continues script if Active is true
player.BackPack:remove() -- Removes BackPack from player
game.Lighting.Backpack:clone().Parent = player -- Clones a empty BackPack into player
end
end
script.Parent.MouseButton1Down:connect(Clicked) -- Tells script what triggers the function
1 comment
0
You would need to copy a empty BackPack to lighting for it to work.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
I have done so... But it isn't working.