Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My jumpscare dosen't pop up when touching a ghost, why?

Asked by
ARTEK22 135
7 years ago

So im preparing for halloween with a brand new game. And i was scripting ghosts but, they don't give me a jumpscare, here's the code!

-- plrcheck.PlayerGui = gui
function scared(player)
    local player.Parent = pparent
    local plrcheck = game.Players:GetPlayerFromCharacter(pparent)
    if plrcheck then
        local screenGui = Instance.new("ScreenGui", plrcheck.Playergui)
        local imageLabel = Instance.new("ImageLabel")
imageLabel.Parent = screenGui
imageLabel.Position = UDim2.new(0, 25, 0, 50)
imageLabel.Size = UDim2.new(1, 0, 1, 0)
imageLabel.Image = "rbxassetid://133049047"
    end
end
script.Parent.Touched:connect(scared)
0
1) Is FE on? 2) What is pparent? 3) Is this a normal script or a local script? 4) Where is this script located in the explorer? GoldenPhysics 474 — 7y
0
FE is not on, but im going to turn it on. pparent is the parent of the part that touched the block. It's a normal script and the script is inside the ghost, ARTEK22 135 — 7y
0
You did that wrong, it shouold be local pparent = player.Parent FrostTaco 90 — 7y

1 answer

Log in to vote
2
Answered by 7 years ago
Edited 7 years ago

Try changing local player.Parent = pparent tolocal pparent = player.Parent

0
If you put you code in an inline code block (the C button), I'll upvote you. GoldenPhysics 474 — 7y
0
Changed :) FrostTaco 90 — 7y
0
Thanks. ARTEK22 135 — 7y
Ad

Answer this question