Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Team/Tool Removing Script Acts Server Sided?

Basic tool remover which removes your tools when you are on the 'Winner!' team, but it acts server sided and removes everybody's tools, not just yours. (LocalScript inside StarterGui)

local plr = game.Players.LocalPlayer
local char = plr.CharacterAdded or plr.CharacterAdded:Wait()

local bp = plr:WaitForChild('Backpack')
while true do
	wait(2)
	if plr.Team.Name == 'Winner!' then
		for i,t in pairs(bp:GetDescendants()) do
			if t and t:IsA('Tool') then
				t:Destroy()
			end
		end
		for i,t2 in pairs(char:GetDescendants()) do
			if t2 and t2:IsA('Tool') then
				t2:Destroy()
			end
		end
	end
end


3 comments

0

How the hell did this question get 324 views

0

honestly have no idea

0

somebody is probably spamming the refresh button

1 answer

✓ Accepted answer

For the char variable, try putting plr.Character or plr.CharacterAdded:Wait() instead.

Instead of doing a while true loop, why not fire a client event whenever you determine the teams?

This discussion is preserved as it was. New answers, comments, and votes are closed.