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
 

Re: ScreenGUI won't delete tool

Previous Thread :: Next Thread 
chillybagpiper is online. chillybagpiper
Joined: 28 Sep 2010
Total Posts: 1092
01 Aug 2017 10:21 AM
What the tool is supposed to do: It's just for roleplay, however, it has a button called "Sterilize tool", when this is clicked it should delete the tool from the user's inventory AND from their Character (if it's equipped).

What I have so far: So far, the tool only shows the GUI when clicked (good), and is correctly positioned.

How the tool is formatted:

tool
Handle
Script - (This is the one that has the delete script)
LocalScript
ScreenGui
Frame
ImageButton

--------------
I tried to use this script:
local Gui = script.Parent.LocalScript.GUI.Frame.ImageButton
local player = game.Players.LocalPlayer
local tool = player.Character:FindFirstChild'Dental Pick'
Gui.MouseButton1Down:Connect(function()
tool:Destroy()
end)

But it doesn't work.
Report Abuse
chillybagpiper is online. chillybagpiper
Joined: 28 Sep 2010
Total Posts: 1092
01 Aug 2017 10:26 AM
Bump :/
Report Abuse
Alpha_yoyo is not online. Alpha_yoyo
Joined: 14 May 2016
Total Posts: 21
01 Aug 2017 10:31 AM
I think you should use the 'If Statement' for the above code
Report Abuse
ExtremeBuilder15 is online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
01 Aug 2017 10:32 AM
I think you need to add parentheses on FindFirstChild("Dental Pick")

if that doesn't work try changing the normal script to a local script, as most(if not all) normal scripts can't view guis in the PlayerGui

Report Abuse
Alpha_yoyo is not online. Alpha_yoyo
Joined: 14 May 2016
Total Posts: 21
01 Aug 2017 10:33 AM
if player.Character:FindFirstChild'Dental Pick

then Tool:Destroy
Report Abuse
Alpha_yoyo is not online. Alpha_yoyo
Joined: 14 May 2016
Total Posts: 21
01 Aug 2017 10:35 AM
nvm im wrong sorry
Report Abuse
Elbixdio is not online. Elbixdio
Joined: 03 Aug 2016
Total Posts: 38
01 Aug 2017 10:39 AM
here: local Gui = script.Parent.LocalScript.GUI.Frame.ImageButton local player = game.Players.LocalPlayer local tool = ###################################### Pick' ####################################### if tool.Parent ~= ### then tool:Destroy() end end)
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