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: Delete OnTouch script not working

Previous Thread :: Next Thread 
TheAsianGamerHD is not online. TheAsianGamerHD
Joined: 02 Apr 2008
Total Posts: 321
18 Sep 2014 03:08 PM
I'm trying to make a brick, that when you touch it, It deletes a sound. However, My script doesn't delete the sound.

function onTouch()
i=game.Workspace.Players:FindFirtChild
i.PlayerGui:Destroy()

I think I know what the problem is, I believe I didn't call the right location. So where would all audio be located when it gets cloned to the Character? I wan't the audio deleted so the player doesn't here the audio AFTER they touch the brick.



-Siggy Updated Because MasterBlokz Is EXTRA Butt Hurt-
Report Abuse
TheAsianGamerHD is not online. TheAsianGamerHD
Joined: 02 Apr 2008
Total Posts: 321
18 Sep 2014 03:09 PM
function onTouch()
i=game.Workspace.Players:FindFirstChild
i.PlayerGui.Ambient:Destroy()

That doesn't work either, can anyone help me out?



-Siggy Updated Because MasterBlokz Is EXTRA Butt Hurt-
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
18 Sep 2014 03:10 PM
script.Parent.Touched:connect(function(hit)
if game.Players:FindFirstChild(hit.Parent.Name) then
local plr = game.Players[hit.Parent.Name]
plr.PlayerGui.Ambient:Destroy()
end
end)
Report Abuse
TheAsianGamerHD is not online. TheAsianGamerHD
Joined: 02 Apr 2008
Total Posts: 321
18 Sep 2014 03:13 PM
Oh my, I really need to develop my scripting skills? Mind giving me a few tips on how to start scripting?

Thanks, god bless you! :)



-Siggy Updated Because MasterBlokz Is EXTRA Butt Hurt-
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
18 Sep 2014 03:16 PM
You didnt hook an event to the function, nor end the fucntion.

function FunctionNameHere(Argument) --Some events dont have arguments
--stuff
end --Ends the fucntion

script.Parent.Touched:connect(FunctionNameHere) --Fires the function with the part that touched it as the argument
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