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: Need Some Help Please

Previous Thread :: Next Thread 
Romul is not online. Romul
Joined: 08 Mar 2009
Total Posts: 597
10 Aug 2012 03:12 PM
Alright, so, I have been off of ROBLOX for almost a year now thanks to being busy and everything, and when I got back, some people informed me of some tools breaking in my game after the recent ROBLOX update.

Here is a little bit about the tool. What it does is place out bricks that deal damage when walked through. Now, my issue is that they are not doing the damage they are supposed to do. It's just placing out bricks to walk through but not dealing damage.

Here is the damage script:


print("Unanchor Loaded")

LandMine = script.Parent

function onTouched(hit)
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 1.5
end

connection = LandMine.Touched:connect(onTouched)


It is located in a HopperBin, if that info is needed. Can anyone please help me figure out what is wrong? I'm completely clueless.

Thank you.
Report Abuse
Romul is not online. Romul
Joined: 08 Mar 2009
Total Posts: 597
10 Aug 2012 03:22 PM
Sorry to bump this, but I really need the help to fix this. :(
Report Abuse
RackHe00 is not online. RackHe00
Joined: 15 Jul 2012
Total Posts: 303
10 Aug 2012 03:23 PM
Remove "connection = ". Add "if hit.Parent:findFirstChild("Humanoid")~=nil then"
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
10 Aug 2012 03:24 PM
local db = false;
script.Parent.Touched:connect(function (p)
if (not p.Parent:findFirstChild("Humanoid")) then return; end
if (db) then return; end
db = true;
p.Parent.Humanoid.Health = p.Parent.Humanoid.Health - 1.5;
wait(0.5);
db = false;
end);
Report Abuse
Romul is not online. Romul
Joined: 08 Mar 2009
Total Posts: 597
11 Aug 2012 12:39 AM
Neither of these worked. I tried them both and it just didn't work. A friend told me that someone fixed it and said it is the '.Touched' part that is broke. He won't show how to fix it though. xD Mean guy. Anyways, is this the problem? If so, how do you fix it?
Report Abuse
NeeRuimte is not online. NeeRuimte
Joined: 01 Jul 2012
Total Posts: 126
11 Aug 2012 12:50 AM
print("Unanchor Loaded")

LandMine = script.Parent

function onTouched(hit)
local Humanoid = hit.Parent:FindFirstChild("Humanoid")
if Humanoid then
Humanoid.Health = Humanoid.Health - 1.5
end
end

LandMine.Touched:connect(onTouched)
Report Abuse
Romul is not online. Romul
Joined: 08 Mar 2009
Total Posts: 597
11 Aug 2012 01:10 AM
Sorry, but that didn't fix it either. :o


The guy said it is the

.Touched

part messed up.


???

D:
Report Abuse
NeeRuimte is not online. NeeRuimte
Joined: 01 Jul 2012
Total Posts: 126
11 Aug 2012 01:21 AM
It's not, can I see the full script?
Report Abuse
Romul is not online. Romul
Joined: 08 Mar 2009
Total Posts: 597
11 Aug 2012 01:27 AM
That is the full damage script. Give me a second and I can get the script that places the bricks.
Report Abuse
Xnite515 is not online. Xnite515
Joined: 18 Feb 2011
Total Posts: 22763
11 Aug 2012 01:29 AM
print("Unanchor Loaded")

local LandMine = script.Parent

function onTouched(hit)
hit.Parent:findFirstChild("Humanoid")
if Humanoid ~= nil then
Humanoid.Health = Humanoid.Health - 1.5
end
end

LandMine.Touched:connect(onTouched)
Report Abuse
Romul is not online. Romul
Joined: 08 Mar 2009
Total Posts: 597
11 Aug 2012 01:36 AM
Here is the script that places the brick that contains the script at the beginning of the thread to deal damage.

local bin = script.Parent
brick = Instance.new("Part")
brick.FormFactor = 2
brick.Size = Vector3.new(3,3,3)
brick.BrickColor = BrickColor.new("Really red")
brick.CanCollide = false
brick.Transparency = 0.2
brick.Anchored = true
script.Parent.Mesh:clone().Parent = brick

enabled = true



function onButton1Down(mouse)
local player = game.Players.LocalPlayer
if player == nil then return end
print("trigger")
-- find the best cf

spew = true
while spew do
wait(.05)
newbrick = brick:clone()
newbrick.Position = mouse.Hit.p
script.Parent.lorva:clone().Parent = newbrick
game.Lighting.Remive:clone().Parent = newbrick
newbrick.Parent = game.Workspace
player.PlayerGui.Chakra.Clock.Value = player.PlayerGui.Chakra.Clock.Value - 1
end
end

function onButton1Up(mouse)
spew = false
end

function onSelected(mouse)
print("select")
mouse.Icon = "rbxasset://textures\\GunCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
mouse.Button1Up:connect(function() onButton1Up(mouse) end)
end

bin.Selected:connect(onSelected)
Report Abuse
Romul is not online. Romul
Joined: 08 Mar 2009
Total Posts: 597
11 Aug 2012 02:04 AM
Did adding the brick adding script help? :o
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
11 Aug 2012 02:09 AM
print("Unanchor Loaded")

LandMine = script.Parent

LandMine.Touched:connect(function(hit)
local Hum = hit.Parent:FindFirstChild("Humanoid")
if Hum ~= nil then
Hum.Health = (Hum.Health - 1.5)
else
return
end
end)
Report Abuse
Romul is not online. Romul
Joined: 08 Mar 2009
Total Posts: 597
11 Aug 2012 08:46 AM
@Xnite, it doesn't deal damage. :S

@Deathmaster, your change broke the script. x3


I don't get how to fix it. xD
Report Abuse
Romul is not online. Romul
Joined: 08 Mar 2009
Total Posts: 597
11 Aug 2012 09:11 AM
Sorry to bump the thread, but it is dire for this to get fixed in order to have the game function properly. D:
Report Abuse
Romul is not online. Romul
Joined: 08 Mar 2009
Total Posts: 597
12 Aug 2012 02:20 PM
So, no one else has an idea? :(
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