I'm new to scripting so some of this might be just really dumb mistakes. So far I had a script that when a player clicked a part then the switch was on and an explosion was created. Now I am trying to make it so that this part is "clicked" or turned on right as the first player joins. I have gotten this far into the code and I'm not sure what to do next.
sp=script.Parent
for _, player in pairs(game.Players:GetChildren()) do
sp.LightSwitch:SetValue(1)
sp.SwitchWeld.C1=CFrame.Angles(.8,0,0)
end
