SpectrumzJoin Date: 2011-03-22 Post Count: 4338 |
function onPlayerEntered(newPlayer)
wait(10)
if newPlayer.Shirt.ShirtTemplate == "http://www.Roblox.com/asset/ID=25173491" then
local l = game.Lighting.LinkedRocketLauncher:Clone()
l.Parent = newPlayer.StarterGear
local p = game.Lighting.LinkedRocketLauncher:Clone()
p.Parent = newPlayer.Backpack
end
end
game.Players.PlayerAdded:connect(onPlayerEntered)
It's supposed to give people with my shirt on (yes i did remember to subtract one from the asset number) a rocket launcher in ten seconds. However, I think that newPlayer brings you right to game.Players, and in game.Players there is no Shirt or ShirtTemplate. |
|
shoukstaJoin Date: 2009-12-01 Post Count: 1906 |
newPlayer.Character |
|
SpectrumzJoin Date: 2011-03-22 Post Count: 4338 |
Lol@shouksta
I've already tried that..... |
|
shoukstaJoin Date: 2009-12-01 Post Count: 1906 |
Then you know it works perfectly >.> |
|
SpectrumzJoin Date: 2011-03-22 Post Count: 4338 |
......No actually <.< |
|
|
I do not believe that a Player has a shirt, I think that it is the Character that has that. |
|
shoukstaJoin Date: 2009-12-01 Post Count: 1906 |
Then it's a problem with your shirt id because newPlayer.Character is the correct way of doing it and theres nothing else wrong with your script so use newPlayer.Character and make sure your shirt id is right. |
|
SpectrumzJoin Date: 2011-03-22 Post Count: 4338 |
function onPlayerEntered(newPlayer)
wait(10)
if newPlayer.Character.Shirt.ShirtTemplate == "http://www.Roblox.com/assetID=25173491" then
local l = game.Lighting.LinkedRocketLauncher:Clone()
l.Parent = newPlayer.StarterGear
local p = game.Lighting.LinkedRocketLauncher:Clone()
p.Parent = newPlayer.Backpack
end
end
game.Players.PlayerAdded:connect(onPlayerEntered)
This is what it is as of right now. Visit my place and see if it doesn't work. |
|
shoukstaJoin Date: 2009-12-01 Post Count: 1906 |
Is the id the same id as the shirt you're wearing or have you -1'd |
|
SpectrumzJoin Date: 2011-03-22 Post Count: 4338 |
I have already subtracted 1 from the shirt ID, which is 25173492, making it 25173491. I double checked. There is something wrong with the script, and Output is being lazy. |
|
SpectrumzJoin Date: 2011-03-22 Post Count: 4338 |
Bump. By the way, since newPlayer brings you to game.Player.WHO EVER THIS IS, and since in the character property in your Player has no Shirt property, having Character would be wrong. |
|
|
"http://www.Roblox.com/assetID=25173491"
Capital 'R' might be a problem as in ShirtTexture (OrWhatever) it has
"http://www.roblox.com/...."
and it is comparing a capital to a lower case so it returns false. |
|
SpectrumzJoin Date: 2011-03-22 Post Count: 4338 |
Nope doesn't change anything. This script is a toughie. |
|
SpectrumzJoin Date: 2011-03-22 Post Count: 4338 |
function onPlayerEntered(newPlayer)
wait(10)
if newPlayer:findFirstChild("Shirt").ShirtTemplate == "http://www.roblox.com/asset/?id=25173491" then
local l = game.Lighting.LinkedRocketLauncher:Clone()
l.Parent = newPlayer.StarterGear
local p = game.Lighting.LinkedRocketLauncher:Clone()
p.Parent = newPlayer.Backpack
end
end
game.Players.PlayerAdded:connect(onPlayerEntered)
I tried this and it STILL doesn't work. |
|
shoukstaJoin Date: 2009-12-01 Post Count: 1906 |
Your still trying to find a shirt in a player when the shirt is inside the players character |
|
SpectrumzJoin Date: 2011-03-22 Post Count: 4338 |
I told you that I've tried that already, but I'll add character to the findfirstchild line and see what happens. |
|
shoukstaJoin Date: 2009-12-01 Post Count: 1906 |
Spectrumz if you have tried it already it's a problem with your asset id because shirt IS inside Player.Character no matter how stubborn you want to be about it I'm right. |
|
SpectrumzJoin Date: 2011-03-22 Post Count: 4338 |
I quadruple checked the shirt ID. This is what it came up with when I typed "print(game.Workspace.Spectrumz.Shirt.ShirtTemplate)" into the command bar: http://www.roblox.com/asset/?id=25173492. I subtracted one from the id number already. This is the script I have INCLUDING character.
function onPlayerEntered(newPlayer)
wait(10)
if newPlayer.Character:findFirstChild("Shirt").ShirtTemplate == "http://www.roblox.com/asset/?id=25173491" then
local l = game.Lighting.LinkedRocketLauncher:Clone()
l.Parent = newPlayer.StarterGear
local p = game.Lighting.LinkedRocketLauncher:Clone()
p.Parent = newPlayer.Backpack
end
end
game.Players.PlayerAdded:connect(onPlayerEntered)
It DOES NOT WORK. Everything is right, the Output says nothing, and I have the shirtID right and everything. Try and make this script your way and see if it works. |
|
shoukstaJoin Date: 2009-12-01 Post Count: 1906 |
function onPlayerEntered(newPlayer)
wait(10)
if newPlayer.Character.Shirt.ShirtTemplate == "http://www.roblox.com/asset/?id=25173491" then
local l = game.Lighting.LinkedRocketLauncher:Clone()
l.Parent = newPlayer.StarterGear
local p = game.Lighting.LinkedRocketLauncher:Clone()
p.Parent = newPlayer.Backpack
end
end
game.Players.PlayerAdded:connect(onPlayerEntered) |
|
CheaterJoin Date: 2007-06-29 Post Count: 5258 |
Why you subtract one from your ID? Doesn't it take another ID then? |
|
SpectrumzJoin Date: 2011-03-22 Post Count: 4338 |
Someone else told me you were supposed to subtract one for it to work. |
|
SpectrumzJoin Date: 2011-03-22 Post Count: 4338 |
On a different thread. But I guess I'll try... for the fiftieth time... |
|
shoukstaJoin Date: 2009-12-01 Post Count: 1906 |
try not subtracting one |
|
thebigbugJoin Date: 2008-09-29 Post Count: 886 |
game.Players.ChildAdded:connect() |
|
SpectrumzJoin Date: 2011-03-22 Post Count: 4338 |
...It works because I didn't subtract one. Wow. I feel incredibly stupid. :P I blame it on the other guy on different thread. :D |
|