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

I'm trying to make a teleporting thingy?

Asked by 4 years ago

local HorrorMusic = game.Workspace.HorrorMusic

script.Parent.MouseButton1Click:Connect(function(h)

local hum = h.Parent:FindFirstChild("Humanoid")

if hum ~= nil then

end

script.Parent.MouseButton1Click:Connect(function()

1    HorrorMusic:Play()
2end)
3    game.Workspace.MouseClickEffect:Play()
4HorrorMusic:Stop()
5h.Parent.HumanoidRootPart.CFrame = CFrame.new(workspace.TelePart.Position)
6game.Lighting.Atmosphere.Density = 1
7game.Lighting.Atmosphere.Haze = 10
8game.Lighting.ClockTime = 0.6
9script.Parent.Parent.Parent.MenuFrame.Visible = false

end)

after i do all the things and i start the game this massage in the output comes for me

Players.DodaKiller_YT.PlayerGui.Menu.MenuFrame.Play.LocalScript:6: attempt to index nil with 'Parent'

0
Please put the whole code in a code block. RazzyPlayz 497 — 4y

1 answer

Log in to vote
0
Answered by
fff054 51
4 years ago

As far as I see, you did not define 'h' in any part of the script and I'm assuming you meant to put 'hum', please next time be sure it's not a typo

0
oo thx it worked DodaKiller_YT 2 — 4y
Ad

Answer this question