generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Kill non- morphs

Previous Thread :: Next Thread 
drco12 is not online. 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 is online. 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 is not online. ayub32
Joined: 27 Dec 2009
Total Posts: 485
23 Feb 2014 03:44 PM
In the killbrick it's GetPlayerFromCharacter()
Report Abuse
drco12 is not online. 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
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
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 is not online. 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 is not online. 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
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image