Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I'm trying to make a teleporting thingy?

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()

	HorrorMusic:Play()
end)
	game.Workspace.MouseClickEffect:Play()
HorrorMusic:Stop()
h.Parent.HumanoidRootPart.CFrame = CFrame.new(workspace.TelePart.Position)
game.Lighting.Atmosphere.Density = 1
game.Lighting.Atmosphere.Haze = 10
game.Lighting.ClockTime = 0.6
script.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'

1 comment

0

Please put the whole code in a code block.

1 answer

✓ Accepted answer

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

1 comment

0

oo thx it worked

This discussion is preserved as it was. New answers, comments, and votes are closed.