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 » Game Design
Home Search
 

Re: help with a script

Previous Thread :: Next Thread 
78B2 is not online. 78B2
Joined: 24 Feb 2013
Total Posts: 62
01 Aug 2016 02:22 PM
I need a block that deletes a model called Ghost in lighting once touched.
Report Abuse
78B2 is not online. 78B2
Joined: 24 Feb 2013
Total Posts: 62
01 Aug 2016 02:26 PM
reumbp
Report Abuse
TheSplinterMan is not online. TheSplinterMan
Joined: 19 Nov 2011
Total Posts: 550
01 Aug 2016 02:27 PM
Commented on your last thread as soon as you started a new one. I think I can help you. Is your ghost a humanoid?
Report Abuse
78B2 is not online. 78B2
Joined: 24 Feb 2013
Total Posts: 62
01 Aug 2016 02:28 PM
No, its a just a group parts that looks like a robloxian. I need a part that destroys the ghost. The ghost is in lighting
Report Abuse
TheSplinterMan is not online. TheSplinterMan
Joined: 19 Nov 2011
Total Posts: 550
01 Aug 2016 02:33 PM
Give me a couple minutes I'm writing and testing the script.
Report Abuse
78B2 is not online. 78B2
Joined: 24 Feb 2013
Total Posts: 62
01 Aug 2016 02:33 PM
rebump
Report Abuse
78B2 is not online. 78B2
Joined: 24 Feb 2013
Total Posts: 62
01 Aug 2016 02:37 PM
rebump again, someone please respon :(
Report Abuse
TheSplinterMan is not online. TheSplinterMan
Joined: 19 Nov 2011
Total Posts: 550
01 Aug 2016 02:42 PM
Ok I'm gonna walk you through this. Make sure you follow every step for it to work properly.

Name your model Ghost. Make sure it's in Workspace.
Name the body parts:
Ghosthead
Ghosttorso
Ghostleftarm
Ghostrightarm
Ghostrightleg
Ghostleftleg


Next, Insert a new brick, or part, and name it whatever you want. I would prefer GhostAppear.

Insert a blank script into GhostAppear and paste this:

--Ghost Appear Script By TheSplinterMan

--Variables
Ghead = game.Workspace.Ghost.Ghosthead
Gtorso = game.Workspace.Ghost.Ghosttorso
GLeftArm = game.Workspace.Ghost.Ghostleftarm
GRightArm = game.Workspace.Ghost.Ghostrightarm
GLeftLeg = game.Workspace.Ghost.Ghostleftleg
GRightLeg = game.Workspace.Ghost.Ghostrightleg


--This is where the magic happens..

function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
wait(0.1)
Ghead.Transparency=0.5 --Change the 0.5's to your desired number
Gtorso.Transparency=0.5
GLeftArm.Transparency=0.5
GRightArm.Transparency=0.5
GLeftLeg.Transparency=0.5
GRightLeg.Transparency=0.5

end
end

script.Parent.Touched:connect(onTouched)

________________________________________________________

Let me know if it works.
Report Abuse
TheSplinterMan is not online. TheSplinterMan
Joined: 19 Nov 2011
Total Posts: 550
01 Aug 2016 02:44 PM
I forgot to mention. After you inserted the script, take all of your Ghostparts and make them invisible by putting the transparency to 1.
Report Abuse
78B2 is not online. 78B2
Joined: 24 Feb 2013
Total Posts: 62
01 Aug 2016 02:45 PM
Cant do that, I need something much more simple than that. I just need a part that destroys a model called Ghost which is in parent lighting when touched. I cant bring Ghost out of lighting because I have about 50 scripts that are based on that position. Recap: I need a simple block that destroys a model called Ghost in parent lighting. (ghost is in lighting)
Report Abuse
qqtt991 is not online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
01 Aug 2016 02:47 PM
Uhm... Isn't it just as simple as this in a brick?

function onTouched(hit)
game.Lighting.Ghost:Destroy()
end

script.Parent.Touched:connect(onTouched)
Report Abuse
78B2 is not online. 78B2
Joined: 24 Feb 2013
Total Posts: 62
01 Aug 2016 02:47 PM
exactly what I needed, thanks.
Report Abuse
casperm8 is not online. casperm8
Joined: 15 Sep 2008
Total Posts: 425
01 Aug 2016 02:48 PM
[directory to Ghost][game.Lighting.Ghost]:destroy() ?

or something like that.
Report Abuse
qqtt991 is not online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
01 Aug 2016 02:49 PM
Eh, hold on. I might as well make the script safe.
Report Abuse
78B2 is not online. 78B2
Joined: 24 Feb 2013
Total Posts: 62
01 Aug 2016 02:49 PM
except it doesnt work for some reason
Report Abuse
TheSplinterMan is not online. TheSplinterMan
Joined: 19 Nov 2011
Total Posts: 550
01 Aug 2016 02:49 PM
function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
wait(0.1)
game.Workspace.Ghost:Destroy()
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
Repsej112 is not online. Repsej112
Joined: 22 Jan 2013
Total Posts: 205
01 Aug 2016 02:51 PM
script.Parent.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
ghost = game.Lightning:FindFirstChild("Ghost")
if ghost then ghost:Destroy()
end)
Report Abuse
78B2 is not online. 78B2
Joined: 24 Feb 2013
Total Posts: 62
01 Aug 2016 02:52 PM
worked, thx
Report Abuse
78B2 is not online. 78B2
Joined: 24 Feb 2013
Total Posts: 62
01 Aug 2016 02:55 PM
Also, how do I make it so when you spawn, your entire body is invisible
Report Abuse
TheSplinterMan is not online. TheSplinterMan
Joined: 19 Nov 2011
Total Posts: 550
01 Aug 2016 02:56 PM
Well now I have a unused button activated ghost script, lol.
Report Abuse
Repsej112 is not online. Repsej112
Joined: 22 Jan 2013
Total Posts: 205
01 Aug 2016 03:01 PM
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
for _, part in ipairs(char:GetChildren()) do
if part:IsA("BasePart")
then part.Transparency = 1
end
end
end)
end)
Report Abuse
Repsej112 is not online. Repsej112
Joined: 22 Jan 2013
Total Posts: 205
01 Aug 2016 03:03 PM
The hats doesnt go invisible though
Report Abuse
Zuzur is not online. Zuzur
Joined: 18 Sep 2012
Total Posts: 177
01 Aug 2016 04:16 PM
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
for _, part in ipairs(char:GetChildren()) do
if part:IsA("BasePart")
then part.Transparency = 1
end
if part:IsA("Hat") then
part:Destroy()
end
end
end)
end)

Quickly added this in, the hats will be gone as well.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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