|
| 27 Oct 2012 12:52 PM |
I am having a few troubles getting a hidden blade on a morph and a gui to work together. I'm using the jetpack design for it. This is what's in the scripts:
function onClick(mouse)
player.Arm2.Blade.Transparency = 0 player.Arm2.Handle.Death.Disabled = false
end
script.Parent.MouseButton1Down:connect(onClick)
And the other is:
function onClick(mouse)
player.Arm2.Blade.Transparency = 1 player.Arm2.Handle.Death.Disabled = true
end
script.Parent.MouseButton1Down:connect(onClick)
'Blade' being the weapon which shows, and 'Death' being a script in the brick that kills. My problem is I can't get it to look like it retracts or extends, or disable the killing script when it is needed. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 28 Oct 2012 10:22 AM |
| You didn't reference what 'player' is. |
|
|
| Report Abuse |
|
|
|
| 17 Nov 2012 09:36 AM |
| Yeah, I realized that when I went to a friend's, thanks for replying, and it's fixed now. |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2012 12:22 PM |
Now, I have a new problem for a gui. It needs to change your health upon clicking the gui button. Here's it:
local player = script.Parent.Parent.Parent.Parent.Parent.Parent.Workspace.Player.Humanoid
function onClick(mouse)
player.Health = 2600 player.MaxHealth = 2600
end
script.Parent.MouseButton1Down:connect(onClick) |
|
|
| Report Abuse |
|
|
jelly134
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 1137 |
|
|
| 15 Dec 2012 12:25 PM |
| FGS I am tired of people doing this. Clicking a gui returns no arguments, remove mouse from the parenthesis. |
|
|
| Report Abuse |
|
|
| |
|
jelly134
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 1137 |
|
|
| 15 Dec 2012 12:30 PM |
| And Player is definitely in the workspace? Even in test mode you don't have player, it's Player1. |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2012 12:32 PM |
| And what do you mean by that? I'm in Build Mode, and all I'm doing is editing and modifying a script from a Jetpack |
|
|
| Report Abuse |
|
|
jelly134
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 1137 |
|
|
| 15 Dec 2012 12:36 PM |
local player = script.Parent.Parent.Parent.Parent.Parent.Parent.Workspace.Player.Humanoid
--I am worried about that line. Is the character definitely called Player? |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2012 12:38 PM |
| So, change it back to Character, if I'm understanding this? |
|
|
| Report Abuse |
|
|
jelly134
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 1137 |
|
|
| 15 Dec 2012 12:41 PM |
| No, what is the name of the Player/Character that you are looking for, e.g. Jelly134, Player1, froufrou21. |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2012 12:42 PM |
| Well, err. I'm not sure what to do, if I put in my name, it'd only work for me, correct? I need it to work for the majority of players. |
|
|
| Report Abuse |
|
|
jelly134
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 1137 |
|
|
| 15 Dec 2012 12:43 PM |
Nvm, this is too painful. I'm just going to assume what you want and I am writing the script for you:
--Put this in a LocalScript rather than a normal one
local player = game.Players.LocalPlayer.Character.Humanoid
script.Parent.MouseButton1Down:connect(function() player.Health = 2600 player.MaxHealth = 2600 end)
|
|
|
| Report Abuse |
|
|
|
| 15 Dec 2012 12:46 PM |
| Well. You did it. Thanks Jelly. |
|
|
| Report Abuse |
|
|
jelly134
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 1137 |
|
|
| 15 Dec 2012 12:48 PM |
Lol, looking back I was very stupid. I didn't realise what you wanted at first :P
This chest infection must be affecting me more than I realise... |
|
|
| Report Abuse |
|
|
| |
|