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

How do I fix this error message? '=' expected near 'end'

Asked by 10 years ago

Hi guys for some reason I keep getting an error message saying:

20:49:33.123 - Players.Player1.Backpack.Tool.LocalScript:21: '=' expected near 'end'

Does anyone know how to fix this. Thanks CrystalCoder.


function GodPowers() if game.Players.LocalPlayer:GetMouse().X<(playerMouse.ViewSizeX/12) then Game.Lighting.TimeOfDay = "06:00:00" elseif game.Players.LocalPlayer:GetMouse().X<(playerMouse.ViewSizeX/12)+(playerMouse.ViewSizeX/12) then Game.Lighting.TimeOfDay = "07:00:00" elseif game.Players.LocalPlayer:GetMouse().X<(playerMouse.ViewSizeX/12)+(playerMouse.ViewSizeX/12)+(playerMouse.ViewSizeX/12) then Game.Lighting.TimeOfDay = "08:00:00" elseif game.Players.LocalPlayer:GetMouse().X<(playerMouse.ViewSizeX/12)+(playerMouse.ViewSizeX/12)+(playerMouse.ViewSizeX/12)+(playerMouse.ViewSizeX/12) then Game.Lighting.TimeOfDay = "09:00:00" end end script.Parent.Equipped:connect(function(eventMouse) while true do wait(0.1) GodPowers end end)
1
Put it into code block, its impossible to read. Tempestatem 884 — 10y

1 answer

Log in to vote
3
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

In the final lines, GodPowers isn't a full statement (Lua is suggesting you fix it by turning it into GodPowers = something).

You need to call the function, by appending parenthesis, rather than just name it:

GodPowers()
0
Thanks BlueTaslem it worked! :) CrystalCoder 20 — 10y
0
Hey BlueTaslem one more question now whenever I unclick the tool it is still running. I know this is because I put at the bottom when the tool is equipped while true do GodPowers but is there anything else I can put instead of while true do so the tool doesn't carry on working even when I unequip it? CrystalCoder 20 — 10y
1
Put that in a new question, please. (Remember to put your code in a code block this time!) Perci1 4988 — 10y
0
Ok thanks! CrystalCoder 20 — 10y
Ad

Answer this question