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
|
  |
| Joined: 24 Feb 2013 |
| Total Posts: 62 |
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 01 Aug 2016 02:33 PM |
| Give me a couple minutes I'm writing and testing the script. |
|
|
| Report Abuse |
|
|
78B2
|
  |
| Joined: 24 Feb 2013 |
| Total Posts: 62 |
|
| |
|
78B2
|
  |
| Joined: 24 Feb 2013 |
| Total Posts: 62 |
|
|
| 01 Aug 2016 02:37 PM |
| rebump again, someone please respon :( |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 24 Feb 2013 |
| Total Posts: 62 |
|
|
| 01 Aug 2016 02:47 PM |
| exactly what I needed, thanks. |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| Joined: 24 Feb 2013 |
| Total Posts: 62 |
|
|
| 01 Aug 2016 02:49 PM |
| except it doesnt work for some reason |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 24 Feb 2013 |
| Total Posts: 62 |
|
| |
|
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 |
|
|
|
| 01 Aug 2016 02:56 PM |
| Well now I have a unused button activated ghost script, lol. |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 22 Jan 2013 |
| Total Posts: 205 |
|
|
| 01 Aug 2016 03:03 PM |
| The hats doesnt go invisible though |
|
|
| Report Abuse |
|
|
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 |
|
|