|
| 24 Aug 2012 07:58 PM |
When I enter the game and say tree, it spawns correctly, but I don't get the ability to move the tree. My character destroys itself, but the tree stays and doesn't become my character. Please help!
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) character = player.Character if msg:lower():sub(1,4) == "tree" then tree = game.Lighting.Tree:clone() tree.Parent = Workspace tree:MakeJoints() repeat wait() until Workspace.Tree player.Character.Parent = Workspace.Tree end end) end)
~repeat wait() until script.Parent:HasALife() |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 08:00 PM |
help!
~repeat wait() until script.Parent:HasALife() |
|
|
| Report Abuse |
|
|
dave2011
|
  |
| Joined: 02 Oct 2010 |
| Total Posts: 10581 |
|
|
| 24 Aug 2012 08:00 PM |
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) character = player.Character if msg:lower():sub(1,4) == "tree" then tree = game.Lighting.Tree:clone() tree.Parent = Workspace tree:MakeJoints() repeat wait() until Workspace.Tree player.Character= Workspace.Tree end end) end) |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 08:04 PM |
Why'd you define character for no reason?
~repeat wait() until script.Parent:HasALife() |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 08:16 PM |
bump
~repeat wait() until script.Parent:HasALife() |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 08:43 PM |
b u m p
~repeat wait() until script.Parent:HasALife() |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 09:07 PM |
hgvhjghjbhjhjjhhjhjjh
~repeat wait() until script.Parent:HasALife() |
|
|
| Report Abuse |
|
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
|
| 24 Aug 2012 09:20 PM |
@Your sig, You probably meant: repeat wait() until script.Parent.HasALife == true |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 09:26 PM |
It's a joke.
~repeat wait() until script.Parent:HasALife() |
|
|
| Report Abuse |
|
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
|
| 24 Aug 2012 09:30 PM |
@The, I understand, but you cannot use the context HasALife for a method. |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 09:49 PM |
I didn't even know it existed.
~repeat wait() until script.Parent:HasALife() |
|
|
| Report Abuse |
|
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
| |
|
|
| 24 Aug 2012 09:59 PM |
"I understand, but you cannot use the context HasALife for a method."
I though you meant it existed LOL.
~repeat wait() until script.Parent:HasALife() |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 09:59 PM |
But, yeah; any help here?
~repeat wait() until script.Parent:HasALife() |
|
|
| Report Abuse |
|
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
|
| 24 Aug 2012 10:00 PM |
@thedeath Yea, I use it on normal basis, if part:HasALife(Middle aged) then print("LIFEEEE") end |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 10:01 PM |
Ok, I get it. Could you help me?
~repeat wait() until script.Parent:HasALife() |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 10:09 PM |
script.Parent.LifeAdded:wait()
i just did what your signature did, but via C-side
anyway you should probably take a look at the output.
¬ SHG Scripter Tier-2, LuaLearners Elite - pm me! |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 10:21 PM |
It doesn't give me anything.
~repeat wait() until script.Parent:HasALife() |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 10:22 PM |
you ought to add some print()'s to your script so you know where it gets stuck. my best bet is that it gets stuck at the loop.
¬ SHG Scripter Tier-2, LuaLearners Elite - pm me! |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 10:26 PM |
ok, lemme do so.
~repeat wait() until script.Parent:HasALife() |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 10:29 PM |
It passes everything.
~repeat wait() until script.Parent:HasALife() |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 10:30 PM |
oh!! how did i not see that.
well, you set the character's parent, instead of just the character.
try player.Character = Workspace.Tree
¬ SHG Scripter Tier-2, LuaLearners Elite - pm me! |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 24 Aug 2012 10:32 PM |
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) character = player.Character if msg:lower():sub(1,4) == "tree" then tree = game.Lighting.Tree:clone() tree.Parent = Workspace tree:MakeJoints() repeat wait() until Workspace:FindFirstChild("Tree") player.Character.Parent = Workspace.Tree end end) end)
Try that.
|
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 10:33 PM |
Nope; that spawns the tree and deletes my character, leaving a control-less tree and me without a character to move around. In the tree model is two parts, the ball (leaves) and the log (a long, tall part).
~repeat wait() until script.Parent:HasALife() |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2012 10:35 PM |
@miz, your script spawns the tree, but keeps my character. So I can't control the tree, I'm still controlling my character. Just like the first script does.
~repeat wait() until script.Parent:HasALife() |
|
|
| Report Abuse |
|
|