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

I am trying to make a door for my platform game and it isn't working plz help?

script.Parent.Touched:Connect(function(hit)

local human = hit.Parent:FindFirstChild("Humanoid")

if human ~= nil then

	local plr = game.Players:GetPlayerFromCharacter(hit.Parent)

	if plr.leaderstats.Points.Value >= 5 then

		script.Parent.Transparency = .5

		script.Parent.Cancollide = false

		wait(5)

		script.Parent.Transparency = 0

		script.Parent.Transparency = true

	end

end

end)

1 answer

Try changing:

if human ~= nil then

into:

if human then

That should solve it

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