Salut, je suis un utilisateur sur Roblox et j'essaie d'écrire un interrupteur qui éteint 4 lumières et j'ai un erreur (c'est dans le titre)Roblox Erreur: Attendu ')' pour fermer '(' à la colonne 3), got '='
Deux blocs sont utilisés, les commutateurs Off4 et On4.
Mon code est
function OnClicked()
if (workspace.LivingRoomLight.SpotLight.Enabled == true) and (workspace.LivingRoomLight2.SpotLight.Enabled == true) and (workspace.LivingRoomLight3.SpotLight.Enabled == true) and (workspace.LivingRoomLight4.SpotLight.Enabled == true) then
(workspace.LivingRoomLight.SpotLight.Enabled = false) and (workspace.LivingRoomLight2.SpotLight.Enabled == false) and (workspace.LivingRoomLight3.SpotLight.Enabled == false) and (workspace.LivingRoomLight3.SpotLight.Enabled == false)
script.Parent.Transparency = 1
workspace.Off4.Transparency = 0
end
end
script.Parent.ClickDetector.MouseClick:connect(OnClicked)
Les autres scripts (ce travail) que j'utilise dans ceux qui utilisent une seule lumière est
function OnClicked()
if (workspace.Hallwaylight.SpotLight.Enabled == true) then
workspace.Hallwaylight.SpotLight.Enabled = false
script.Parent.Transparency = 1
workspace.Off.Transparency = 0
end
end
script.Parent.ClickDetector.MouseClick:connect(OnClicked)
Note: Je n'utilise le sur des scripts parce que ce le seul que j'ai édité pour celui avec l'erreur. L'erreur dans le script est sur la première = à la colonne 3 et quand je l'utilise « == » au lieu de « = » alors la ligne entière devient une erreur
Il suffit de mettre les conditions entre parenthèses (if()) pas les opérations. –