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

it says expected end to close then at line 6?

Asked by 2 years ago
Edited 2 years ago

~~~~~~~~~~~~~~~~~

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)

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 Jakob_Cashy 79 — 2y
0
sorry its being buggy for some reason Ey_Yatzy 11 — 2y
0
attempt to understand error messages better, its going to benefit you a lot RAFA1608 543 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago
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

0
wait. it didnt give me errors but it isnt doing what i intended it to do. it might just be my code then Ey_Yatzy 11 — 2y
Ad

Answer this question