|
| 02 Jan 2012 09:57 AM |
I have no idea whats wrong, there is no output!
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(plyh) if plyh~=nil then p=texture for i=1,#p do if game.Player:GetPlayerFromCharacter(plyh).Torso.roblox.texture == true then Sniper = game.Lighting.SUF:clone() Sniper.Parent = player.Backpack -- Add more guns below this one end end end end
script.Parent.Touched:connect(giveGunsOssimPeople) |
|
|
| Report Abuse |
|
|
jode6543
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 5363 |
|
|
| 02 Jan 2012 10:03 AM |
a) p=texture for i=1,#p do
p is a string, not a table. You can't iterate through a string.
b) if game.Player:GetPlayerFromCharacter(plyh).Torso.roblox.texture == true then errrr.... What?
c) 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
You never even call this function.
~THROW THE CHEEEEEEEEEEEEEEEEEEEESE!~ |
|
|
| Report Abuse |
|
|
DXPower
|
  |
| Joined: 21 Oct 2008 |
| Total Posts: 2866 |
|
|
| 02 Jan 2012 10:05 AM |
function giveGunsOssimPeople(hit) if (hit.Parent:findFirstChild("Humanoid") ~=nil) then local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player~=nil then 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) |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2012 10:06 AM |
All I want is a script that gives the player a certain gun if he is wearing a certain t-shirt.
Is that too hard? |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2012 10:08 AM |
Where does the texture come in there DX
|
|
|
| Report Abuse |
|
|
jode6543
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 5363 |
|
|
| 02 Jan 2012 10:10 AM |
Working off DX's:
local texture = "whatever the texture was"
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 local Sniper = game.Lighting.SUF:clone() Sniper.Parent = player.Backpack -- Add more guns below this one end end end end end
script.Parent.Touched:connect(giveGunsOssimPeople)
~THROW THE CHEEEEEEEEEEEEEEEEEEEESE!~ |
|
|
| Report Abuse |
|
|
bob354293
|
  |
| Joined: 26 Oct 2008 |
| Total Posts: 2609 |
|
|
| 02 Jan 2012 10:12 AM |
ohhh easy sorta
function onTouched(hit) if game.Lighting:FindFirstChild:(gun) =~ nil and game.Players:FindFirstChild(hit.Parent.Name).BackPack:findFirstChild(gun) =~ nil and game.Workspace:FindFirstChild(hit.Parent.Name).""""""Idk bout this bit...""""".Texture == "Tshirt texture here" then game.Lighting.Gun:clone().Parent = game.Players:FindFirstChild(hit.Parent.Name).Backpack end end
script.Parent.Touched:connect(onTouched)
|
|
|
| Report Abuse |
|
|
bob354293
|
  |
| Joined: 26 Oct 2008 |
| Total Posts: 2609 |
|
|
| 02 Jan 2012 10:12 AM |
| you might have to look in the output and fix mine a little bit ... :p |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2012 10:16 AM |
I cant even read yours bob.
put some returns in there |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2012 10:19 AM |
Jode,
Would I call the function of giveGun(gun, player) like this?
script.Parent.Touched:connect(giveGun) ? |
|
|
| Report Abuse |
|
|
DXPower
|
  |
| Joined: 21 Oct 2008 |
| Total Posts: 2866 |
|
|
| 02 Jan 2012 03:05 PM |
Use a table full of textures, and make a for loop for each of the items in the table:
texture = {"Texture1","Texture2","Texture3"}
for i = 1, #texture do if texture[i] == .....roblox.texture then
...
... ... end
I didn't add the one function because I didn't know what it was doing, also, almost all your variables were wrong. |
|
|
| Report Abuse |
|
|