So, I have this function right here.
BotUp.Button.MouseButton1Click:connect(function()
if BotUp.ImageColor3 == Color3.fromRGB(255,255,255) then
if Level.Value >= BottomUpgrade.Level.Value then
if Cash.Value >= BottomUpgrade.Cost.Value then
UpgradeEvent:FireServer(LocalPlayer,TOWER,"Bottom")
end
end
end
end)
It works pretty well. However, I cannot change the variable TOWER from outside of the function and let it take effect inside of the function. If there is a way to do what the function does above and let the rest of the script change TOWER and let it take effect, please tell me! I would be massively thankful!

1 comment
If you declared TOWER above this function, you should have no trouble changing it elsewhere. But you're not showing us where you declare it, nor where you're trying to change it from, so there's not enough here for anyone to really help you.