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
 

Re: Player On Fire Script. Help.

Previous Thread :: Next Thread 
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
07 Jul 2012 08:46 PM
Hello fellow scripters, Today I'm trying to make a script that sets your player on fire when you touch the brick that has this script in it.

Now my problem is I don't know how to define the player's torso... But here's my script.

--Made by GuestHaxx

local brick = Workspace.Brick -- Store a reference to the brick.

function onTouched(hit)
print("Door Hit")
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
-- a human has touched this door!
print("Human touched door")
then local fire = Instance.new("Fire",Torso)--Torso is what will catch on fire.
fire.Heat = 9
fire.Size = 5
fire.Color = Color3.new(255,127,0)
fire.SecondaryColor = Color3.new (255,0,0)
local smoke = Instance.new("Smoke",Torso)--Torso is what will smoke.
smoke.Opacity = .5
smoke.RiseVelocity = 10
smoke.Size = 10
smoke.Color = Color3.new(28, 28, 28)





end
end

end

connection = Door.Touched:connect(onTouched)

I don't know if the word "define" is the right word... But how do I get the player's torso to catch on fire/smoke when the player touches the brick?

If none of that made sense please read this example:

Player touches brick
Player Catches one fire/smoke



Note: I'm fairly new to scripting, so I don't know all the right terminology.
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
07 Jul 2012 08:57 PM
Help.
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
07 Jul 2012 09:06 PM
Help?
Report Abuse
marioblox1094 is not online. marioblox1094
Joined: 14 Aug 2010
Total Posts: 1839
07 Jul 2012 09:07 PM
local brick = Workspace.Brick -- Store a reference to the brick.

function onTouched(hit)
print("Door Hit")
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
-- a human has touched this door!
print("Human touched door")
local fire = Instance.new("Fire",Torso)--Torso is what will catch on fire.
fire.Heat = 9
fire.Size = 5
fire.Color = Color3.new(255,127,0)
fire.SecondaryColor = Color3.new (255,0,0)
local smoke = Instance.new("Smoke",Torso)--Torso is what will smoke.
smoke.Opacity = .5
smoke.RiseVelocity = 10
smoke.Size = 10
smoke.Color = Color3.new(28, 28, 28)





end
end

end

connection = Door.Touched:connect(onTouched)
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
07 Jul 2012 09:10 PM
Huh? Nothing has changed.
Report Abuse
marioblox1094 is not online. marioblox1094
Joined: 14 Aug 2010
Total Posts: 1839
07 Jul 2012 09:15 PM
yes it has
Report Abuse
logeykiller is not online. logeykiller
Joined: 19 Mar 2011
Total Posts: 8
07 Jul 2012 09:19 PM
Remove the 'then' before local fire.
Then it SHOULD work.
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
07 Jul 2012 09:20 PM
Okay well text wise but not result wise...

Report Abuse
logeykiller is not online. logeykiller
Joined: 19 Mar 2011
Total Posts: 8
07 Jul 2012 09:20 PM
And what is with connection = BLAHBLAHBLAH?
Report Abuse
logeykiller is not online. logeykiller
Joined: 19 Mar 2011
Total Posts: 8
07 Jul 2012 09:21 PM
local brick = Workspace.Brick -- Store a reference to the brick.

function onTouched(hit)
print("Door Hit")
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
-- a human has touched this door!
print("Human touched door")
local fire = Instance.new("Fire",Torso)--Torso is what will catch on fire.
fire.Heat = 9
fire.Size = 5
fire.Color = Color3.new(255,127,0)
fire.SecondaryColor = Color3.new (255,0,0)
local smoke = Instance.new("Smoke",Torso)--Torso is what will smoke.
smoke.Opacity = .5
smoke.RiseVelocity = 10
smoke.Size = 10
smoke.Color = Color3.new(28, 28, 28)
end
end
game.Workspace.Door.Touched:connect(onTouched)
Report Abuse
logeykiller is not online. logeykiller
Joined: 19 Mar 2011
Total Posts: 8
07 Jul 2012 09:24 PM
Oops, TRY THIS INSTEAD.


local brick = Workspace.Brick -- Store a reference to the brick.

function onTouched(hit)
print("Door Hit")
local human = hit.Parent:findFirstChild("Humanoid")
if human ~= then
-- a human has touched this door!
print("Human touched door")
local fire = Instance.new("Fire")--Torso is what will catch on fire.
fire.Heat = 9
fire.Size = 5
fire.Color = Color3.new(255/255,127/255,0/255)
fire.SecondaryColor = Color3.new (255/155,0/255,0/255)
fire.Parent = hit.Parent.Torso
local smoke = Instance.new("Smoke")--Torso is what will smoke.
smoke.Opacity = .5
smoke.RiseVelocity = 10
smoke.Size = 10
smoke.Color = Color3.new(28, 28, 28)
smoke.Parent = hit.Parent.Torso
end
end
game.Workspace.Door.Touched:connect(onTouched)
Report Abuse
logeykiller is not online. logeykiller
Joined: 19 Mar 2011
Total Posts: 8
07 Jul 2012 09:25 PM
Also, what is local brick for?
You didn't use the variable brick ANYWHERE.
This is probably a free model. e.e'
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
07 Jul 2012 09:27 PM
Okay I just found out I need to have this some where in it...

local players = Workspace:FindFirstChild("Player")

Better if I just start over from scratch...

NEW SCRIPT:

function onTouched(hit)
print("Door Hit")
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
-- a human has touched this door!
print("Human touched door")

--Now, this is where I'm going to need help with...

local smoke = Instance.new("Smoke",Torso)--Torso is what will smoke.
smoke.Opacity = .5
smoke.RiseVelocity = 10
smoke.Size = 10
smoke.Color = Color3.new(28, 28, 28)
end
end
game.Workspace.Door.Touched:connect(onTouched)



Would I need to do something like findFirstChild("Humanoid",Torso) to make the smoke emit from the players torso??
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
07 Jul 2012 09:27 PM
@logeykiller yes it is free model -_- I using the free model scripts to help me learn.
Report Abuse
logeykiller is not online. logeykiller
Joined: 19 Mar 2011
Total Posts: 8
07 Jul 2012 09:30 PM
Dude, don't use Free Models. Use the wiki guide. And if you come across something in a script you don't understand, go to the wiki and search for it. When you find it. Memorize it and attempt it til you get it right. That's how I learned. No one would teach me. They all bailed. An yet I may have already surpassed them. >:D
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
07 Jul 2012 09:37 PM
oh okay... well I know I need this.. according to the roblox wiki...

Instance.new('Fire', Workspace.Torso).Size = 25--FIRE!!!! IF only it worked....

I know how to make a OnTouch Explosion but not a OnTouch and you get burned..

And a any brick function? How you do that?
Report Abuse
johnhugh is not online. johnhugh
Joined: 26 Mar 2009
Total Posts: 1971
07 Jul 2012 09:49 PM
I made a script that does this, slows your walkspeed, and kills you :)
It was my first script made 100% by me and my knowledge
Good times.
Report Abuse
johnhugh is not online. johnhugh
Joined: 26 Mar 2009
Total Posts: 1971
07 Jul 2012 09:50 PM
and btw, hax using free models to look at scripts and try to define what each line is for is actually a good way to test yourself
Report Abuse
DroptheBomb is not online. DroptheBomb
Joined: 04 Nov 2010
Total Posts: 235
07 Jul 2012 09:52 PM
damage = 0 --just something extra i dunno :)
firesize = 5

workspace["Door"].Touched:connect(function(hit)
local p = game.Players:GetPlayerFromCharacter(hit.Parent)
if (p~=nil) then
local t = p.Character:FindFirstChild("Torso")
if (t~=nil) then
local f = Instance.new("Fire", t)
local sm = Instance.new("Smoke", t)
f.Size = firesize
sm.Size = 10
sm.Color = Color3.new(28/255, 28/255, 28/255)
if (damage>0) then
coroutine.resume(coroutine.create(function()
while wait(.2) do
local h = p.Character:FindFirstChild("Humanoid")
if (h~=nil) then
local he = h.Health
if (he<=damage) then
p.Character:BreakJoints()
else
h.Health = he-damage
end
end
end
end))
end
end
end
end)
Report Abuse
johnhugh is not online. johnhugh
Joined: 26 Mar 2009
Total Posts: 1971
07 Jul 2012 09:53 PM
it is, also much simpler and better to start out with trying to avoid having to use Argument 2 ie (arg1, arg2)

so therefore
fire = Instance.new("Fire")
fire.Parent = hit.Parent.Torso
smoke = Instance.new("Smoke")
smoke.Parent = hit.Parent.Torso

and set the other propertes such as heat, color etc
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