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 » Scripters
Home Search
 

Easy function not working?

Previous Thread :: Next Thread 
thegoodpuppy is not online. thegoodpuppy
Joined: 07 Jul 2011
Total Posts: 2737
18 Oct 2016 09:17 PM
Im trying to make a part move along a path of many little parts, and when the moving part hits something, the thing it hit is removed. The move function works, but not the "hit" function.

On = false

function DynamiteOn()
if On == false then
On = true
while true do
if On == true then
script.Parent.FirePart.CFrame = script.Parent.FirePart.CFrame + Vector3.new(-0.2, 0, 0)
wait(0.1)
end
end
end
end

script.Parent.Button.ClickDetector.MouseClick:connect(DynamiteOn)

function DynamiteHitSomething(touched)
if On == true then
if touched.Parent:FindFirstChild("Humanoid") then

elseif touched.Parent == "Workspace" then
touched:Destroy()
end
end
end


script.Parent.FirePart.Touched:connect(DynamiteHitSomething)
Report Abuse
Burglered is not online. Burglered
Joined: 14 Jul 2011
Total Posts: 962
18 Oct 2016 09:21 PM
"if touched.Parent:FindFirstChild("Humanoid") then"

I thought you were deleting parts, not characters


Report Abuse
thegoodpuppy is not online. thegoodpuppy
Joined: 07 Jul 2011
Total Posts: 2737
18 Oct 2016 09:22 PM
Yes, but I have the else if there so it doesn't affect anything. Ignore that part
Report Abuse
thegoodpuppy is not online. thegoodpuppy
Joined: 07 Jul 2011
Total Posts: 2737
18 Oct 2016 09:24 PM
I have that there because later on I am going to add some stuff if it detects a character, if your wondering.
Report Abuse
thegoodpuppy is not online. thegoodpuppy
Joined: 07 Jul 2011
Total Posts: 2737
18 Oct 2016 09:26 PM
"if touched.Parent:FindFirstChild("Humanoid") then

elseif touched.Parent == "Workspace" then
touched:Destroy()
end"

This will not do anything right now if it is a character, because the script is not told to.

However, if the touched thing is a child of workspace, parts not in a model, then it will be destroyed.
Report Abuse
thegoodpuppy is not online. thegoodpuppy
Joined: 07 Jul 2011
Total Posts: 2737
18 Oct 2016 09:33 PM
Bump, it can't be that hard to help a new scripter out
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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