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
|
  |
| Joined: 16 Apr 2012 |
| Total Posts: 3370 |
|
| |
|
GUESTHAXX
|
  |
| Joined: 16 Apr 2012 |
| Total Posts: 3370 |
|
| |
|
|
| 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
|
  |
| Joined: 16 Apr 2012 |
| Total Posts: 3370 |
|
| |
|
| |
|
|
| 07 Jul 2012 09:19 PM |
Remove the 'then' before local fire. Then it SHOULD work. |
|
|
| Report Abuse |
|
|
GUESTHAXX
|
  |
| Joined: 16 Apr 2012 |
| Total Posts: 3370 |
|
|
| 07 Jul 2012 09:20 PM |
Okay well text wise but not result wise...
|
|
|
| Report Abuse |
|
|
|
| 07 Jul 2012 09:20 PM |
| And what is with connection = BLAHBLAHBLAH? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|