|
| 08 Jul 2015 02:03 PM |
So I've got a tycoon functioning, but I have realised if something other than a player touches the tycoon, then it assigns that tycoon it something that isn't a player. I've tried to get it to find what the primary part is but I've had no luck. It doesn't read an error
script.Parent.Touched:connect(function(z) if script.Parent.Parent.Name == "UnOwnedTycoon" and z.Parent.PrimaryPart == Head then script.Parent.Parent.Name = z.Parent.Name .. "'s tycoon" print(z) print(z.Parent)
end owner = z.Parent.Name end)
▲☭⎊▲Obama is a giant overlord space lizard▲⎊☭▲ |
|
|
| Report Abuse |
|
|
igunaa
|
  |
| Joined: 15 Sep 2010 |
| Total Posts: 2588 |
|
|
| 08 Jul 2015 02:06 PM |
Try using Humanoid else than PrimaryPart == Head
It`d be like
script.Parent.Touched:connect(function(z) if script.Parent.Parent.Name == "UnOwnedTycoon" and z.Parent.Humanoid ~= nil then
script.Parent.Parent.Name = z.Parent.Name .. "'s tycoon" print(z) print(z.Parent)
end owner = z.Parent.Name end)
|
|
|
| Report Abuse |
|
|
|
| 09 Jul 2015 06:38 AM |
That works great, thanks!
▲☭⎊▲Obama is a giant overlord space lizard▲⎊☭▲ |
|
|
| Report Abuse |
|
|