Ad
Log in to vote
0

it says expected end to close then at line 6?

Asked by 3 days ago
Edited 3 days 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 35 — 3d
0
sorry its being buggy for some reason Ey_Yatzy 6 — 3d
0
attempt to understand error messages better, its going to benefit you a lot RAFA1608 448 — 3d

1 answer

Log in to vote
0
Answered by 3 days 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 6 — 3d
Ad

Answer this question