drco12
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 234 |
|
|
| 23 Feb 2014 03:33 PM |
I am looking for a way to make a brick kill non-morphed players... these are the scripts I have, but there seem to be some errors. Can someone help me fix it?
Here is the script:
-- This goes into workspace function onPlayerEntered(newPlayer)
local bool = Instance.new("BoolValue", newPlayer)
bool.Name = "Morphed"
end
game.Players.PlayerAdded:connect(onPlayerEntered)
--This goes into the morph: WHATEVERPLAYERISINSCRIPT.Morphed = true
--This goes into the kill brick: function onTouched(hit) if hit.Parent.Humanoid ~= nil then local player = hit.Parent:GetPlayerFromCharacter if player.Morphed == false then -- There is an error on this line. hit.Parent.Humanoid.Health = 0
end end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
Laedere
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 23601 |
|
|
| 23 Feb 2014 03:35 PM |
| because there's no such thing as "Morphed" |
|
|
| Report Abuse |
|
|
ayub32
|
  |
| Joined: 27 Dec 2009 |
| Total Posts: 485 |
|
|
| 23 Feb 2014 03:44 PM |
| In the killbrick it's GetPlayerFromCharacter() |
|
|
| Report Abuse |
|
|
drco12
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 234 |
|
|
| 23 Feb 2014 05:54 PM |
| Would it be possible for someone to post a fixed version of this script; or a better one that kills non-morphs but allows morphed people to live? |
|
|
| Report Abuse |
|
|
|
| 23 Feb 2014 06:04 PM |
Workspace script:
function onPlayerEntered(newPlayer) local bool = Instance.new("BoolValue") bool.Parent = newPlayer bool.Name = "Morphed" end
game.Players.PlayerAdded:connect(onPlayerEntered)
Kill brick script:
function onTouched(hit) if hit.Parent.Humanoid ~= nil then local player = game.Players:GetPlayerFromCharacter(hit.Parent) --This is how you use GetPlayerFromCharacter() correctly. if player.Morphed == false then player.Character.Humanoid.Health = 0 end end end
script.Parent.Touched:connect(onTouched)
For the script in the morph, be sure to reference the player correctly. If the player is referenced as p, then put in "p.Morphed.Value = true" (Without the "s), same for player (player.Morphed.Value = true) and so on.
When life gives you lemons... BURN HIS HOUSE DOWN! >:D |
|
|
| Report Abuse |
|
|
drco12
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 234 |
|
|
| 23 Feb 2014 11:09 PM |
| Wait, so what exactly would you put into the morph? |
|
|
| Report Abuse |
|
|
drco12
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 234 |
|
|
| 23 Feb 2014 11:26 PM |
Nothing happened in the kill brick... when the morph or a regular player stepped on it. :O
Help? :) |
|
|
| Report Abuse |
|
|
|
| 24 Feb 2014 02:04 AM |
"Wait, so what exactly would you put into the morph?" Could you send me the model of the morph, or could you post the script that morphs you?
When life gives you lemons... BURN HIS HOUSE DOWN! >:D |
|
|
| Report Abuse |
|
|