So basically I have a model which contains seven parts. Those parts contain either nothing or a mesh... I grouped them up, and named it Assassin. Then I have a brick nearby and grouped it with the Model Assassin, and called it Thingymabob -- Don't judge. I want this Assassin to appear, when someone walks through the invisible, non-CanCollidable Thingymabob. So the Assassin starts off as invisible. (I also want several sounds to play when someone walks through it.)
So I made a script, but it's not working. Can someone help? This is the first script for the Transparency:
local Door = script.Parent.Thingymabob
Item = script.Parent.Parent.Assassin
a = Item.Head
b = Item.Sword
c = Item.Handle
d = Item.RLeg
e = Item.LLeg
f = Item.RArm
g = Item.Torso
function onTouched(hit)
print("Door Hit")
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
print ("Human touched door")
a.Transparency = 0.9
b.Transparency = 0.9
c.Transparency = 0.9
d.Transparency = 0.9
e.Transparency = 0.9
f.Transparency = 0.9
g.Transparency = 0.9
wait (0.5)
a.Transparency = 0.5
b.Transparency = 0.5
c.Transparency = 0.5
d.Transparency = 0.5
e.Transparency = 0.5
f.Transparency = 0.5
g.Transparency = 0.5
wait (0.5)
a.Transparency = 0.2
b.Transparency = 0.2
c.Transparency = 0.2
d.Transparency = 0.2
e.Transparency = 0.2
f.Transparency = 0.2
g.Transparency = 0.2
wait (0.5)
a.Transparency = 0
b.Transparency = 0
c.Transparency = 0
d.Transparency = 0
e.Transparency = 0
f.Transparency = 0
g.Transparency = 0
wait (5)
a.Transparency = 0.4
b.Transparency = 0.4
c.Transparency = 0.4
d.Transparency = 0.4
e.Transparency = 0.4
f.Transparency = 0.4
g.Transparency = 0.4
wait (0.5)
a.Transparency = 0.8
b.Transparency = 0.8
c.Transparency = 0.8
d.Transparency = 0.8
e.Transparency = 0.8
f.Transparency = 0.8
g.Transparency = 0.8
wait (0.5)
a.Transparency = 1
b.Transparency = 1
c.Transparency = 1
d.Transparency = 1
e.Transparency = 1
f.Transparency = 1
g.Transparency = 1
while (human.health > 0) do
human.health = human.health - 5
end
end
end
script.Parent.Touched:connect(onTouched)
This is the second script for Sound:
local Door = script.Parent
function onTouched(hit)
print ("Door hit")
local human = hit.parent:findFirstChild("Humanoid")
if (human ~= nil) then
print ("Human touched door")
wait(1)
script.Sound1:Play()
script.Sound2:Play()
script.Sound3:Play()
script.Sound4:Play()
script.Sound5:Play()
script.Sound6:Play()
script.Sound7:Play()
script.Sound8:Play()
script.Sound9:Play()
script.Sound10:Play() -- I have 10 Sounds.
wait(10)
end
end
script.Parent.Touched:connect(onTouched)
These scripts are inside 'Thingymabob'
Thank you.

1 comment
Kk Thx