Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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 comment

1

Put it into code block, its impossible to read.

1 answer

✓ Accepted answer

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()

4 comments

0

Thanks BlueTaslem it worked! :)

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?

1

Put that in a new question, please. (Remember to put your code in a code block this time!)

0

Ok thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.