|
| 08 Aug 2011 05:46 PM |
This script is meant to give anyone who touches the brick a weapon. Its badly wrong. I dont know where though. Thank you in advance.
local debounce = false Weapon = game.Lighting:findFirstChild"44Caliber" function getPlayer(humanoid) local players = game.Players:children() for i = 1, #players do if players[i].Character.Humanoid == humanoid then return players[i] end end return nil end
function onTouch(part)
local human = part.Parent:findFirstChild("Humanoid") if (human ~= nil) and debounce == false then
debounce = true
local player = getPlayer(human)
if (player == nil) then return end
Weapon:clone().Parent = player.Backpack
wait(2) debounce = false end end
script.Parent.Parent.Touched:connect(onTouch)
|
|
|
| Report Abuse |
|
|
|
| 08 Aug 2011 06:14 PM |
weapon = game.Lighting["44Caliber"] local deb = false script.Parent.Touched:connect(function(hit) if hit and hit.Parent and game.Players:GetPlayerFromCharacter(hit.Parent) and not deb then deb = true weapon:clone().Parent = game.Players:GetPlayerFromCharacter(hit.Parent).Backpack wait(2) deb = false end end) |
|
|
| Report Abuse |
|
|
| |
|