|
| 02 Jan 2012 04:14 PM |
local texture = "http://www.roblox.com/asset/?id=63730951"
function giveGun(gun, player) if player~=nil then if game.Lighting:findFirstChild(gun) ~= nil then if player.Backpack:findFirstChild(gun) == nil then if player.Character:findFirstChild(gun) == nil then cl = game.Lighting:findFirstChild(gun):clone() cl.Parent = player.Backpack end end end end end
function giveGunsOssimPeople(hit) if (hit.Parent:findFirstChild("Humanoid") ~=nil) then local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player~=nil then if player.Character.Torso.roblox.Texture == texture then wait(3) local Sniper = game.Lighting.SUF:clone() Sniper.Parent = player.Backpack -- Add more guns below this one end end end end
script.Parent.Touched:connect(giveGunsOssimPeople)
Function Givegun(gun, player) does not work. How will it? |
|
|
| Report Abuse |
|
|
NeonBlox
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1462 |
|
|
| 02 Jan 2012 04:19 PM |
You never defined it as a touch function. Therefore, it won't run unless you call it. I believe simply adding the following line will fix it, unless there is another error somewhere.
script.Parent.Touched:connect(giveGun) |
|
|
| Report Abuse |
|
|
3lex33
|
  |
| Joined: 08 Oct 2008 |
| Total Posts: 5220 |
|
|
| 02 Jan 2012 04:20 PM |
| When did you apply the function? |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2012 04:25 PM |
@neon,
would I add it at the end of the script or right below the function? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
C0D3Y
|
  |
| Joined: 24 Jul 2010 |
| Total Posts: 1692 |
|
|
| 02 Jan 2012 06:25 PM |
local texture = "http://www.roblox.com/asset/?id=63730951"
function giveGunsOssimPeople(hit) if hit.Parent:findFirstChild("Humanoid") then local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player~=nil then if player.Character.Shirt.Texture == texture then wait(3) local Sniper = game.Lighting.SUF:clone(player.Backpack) end end end
script.Parent.Touched:connect(giveGunsOssimPeople)
Try it... This script is untested |
|
|
| Report Abuse |
|
|
| |
|