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

it says expected end to close then at line 6?



local player = game.Players.LocalPlayer

game.Workspace.Proximity.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr == player then print("Player touched") game.Lighting.old.Enabled = true

wait(5) local player = game.Players.LocalPlayer

game.Workspace.Proximity.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr == player then print("Player touched") game.Lighting.old.Enabled = false


		end
	end
end)

3 comments

0

uh can u use that blue circle button and put the script inside the squiggly lines? this is extremly hard to read without proper lua form

0

sorry its being buggy for some reason

0

attempt to understand error messages better, its going to benefit you a lot

1 answer

local player = game.Players.LocalPlayer

game.Workspace.Proximity.Touched:Connect(function(hit) 
    if hit.Parent:FindFirstChild("Humanoid") then 
        local plr = game.Players:GetPlayerFromCharacter(hit.Parent) 
        if plr == player then
            print("Player touched")
			game.Lighting.old.Enabled = true
		end
	end
end)
	
	wait(5)
	local player = game.Players.LocalPlayer

game.Workspace.Proximity.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local plr = game.Players:GetPlayerFromCharacter(hit.Parent) 
        if plr == player then
            print("Player touched")
            game.Lighting.old.Enabled = false
		end
	end
end)

Try the above code and see if that works

1 comment

0

wait. it didnt give me errors but it isnt doing what i intended it to do. it might just be my code then

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