✓ Accepted answer
Okay. There are 2 problems now. The first, is that we cannot use a if statement for mousebutton1click. Instead, do this:
script.Parent.MouseButton1Click:Connect(function()
end)
The 2nd problem is REALLY IMPORTANT, that could help you forever in Roblox studio.
In Roblox, there are two types of view: the "local" view and the "server" view.
Local scripts changes what is in the local view and server scripts for server view.
So that script you added is surely in a LocalScript. And the Adding Strength function is surely in a Server Script. So they change the same intvalue, but in different views.
What you can do is to change that LocalScript into a script, but you cannot do that in GUIs. So here comes those REMOTE EVENTS. They can transfer signals from a LocalScript to a server script, to get the same view.
Now, what I suggest to do is to add a REMOTE EVENT in the REPLICATED STORAGE. Name it whatever you want. Now, insert this in the LOCALSCRIPT of the text button:
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage:WaitForChild(YOUR REMOTE EVENT NAME HERE):FireServer()
end)
Now, you need a server script to recieve the signal. Insert this in a server script in Workspace:
game.ReplicatedStorage:WaitForChild(REMOTE EVENT NAME HERE).OnServerEvent:Connect(function(player)
end)
Hope this helped!
If it worked, please accept my answer. I wrote all this on my phone for 30 mins, cuz there's no keyboard. Thanks!