Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-3

How to take away gear when you click teleportation GUI? [closed]

Asked by 9 years ago

This question already has an answer here:

How to take away gear when teleport?

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).

Marked as Duplicate by Tkdriverx, adark, and BlueTaslem

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 9 years ago

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)
0
I have done so... But it isn't working. hunkilicous12 2 — 9y
Ad
Log in to vote
-1
Answered by 9 years ago

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
0
You would need to copy a empty BackPack to lighting for it to work. spikeyajay123123 0 — 9y