Hello, I have this code inside of a button in a GUI.
local rs = game:GetService("ReplicatedStorage")
local C = rs:WaitForChild("Client"):WaitForChild("Connection")
auto = false
if auto == false then
script.Parent.Text = "Auto: OFF"
elseif auto == true then
script.Parent.Text = "Auto: ON"
end
script.Parent.MouseButton1Click:Connect(function()
local player = script.Parent.Parent.Parent.Parent.Parent
if auto == false then
auto = true
script.Parent.Text = "Auto: ON"
while auto do
wait(0.1)
player.Clicks.Value += 1 * player.Multi.Value
player.leaderstats["Total Clicks"].Value += 1 * player.Multi.Value
local chance = math.random(1,10)
if chance == 1 then
player.Gems.Value += math.random(0.25,1)
C:FireClient(player,"MultiUp2")
end
end
else
if auto == true then
auto = false
script.Parent.Text = "Auto: OFF"
end
end
end)
And here’s the code for the remoteevent:
local rs = game:GetService("ReplicatedStorage")
local MU = rs:WaitForChild("Server"):WaitForChild("MultiUp")
MU.OnServerEvent:Connect(function(plr,arg)
if arg == "automultiup" then
plr.Multi.Value += string.format('%.1f',math.random(0.1,0.15))
print("recieved data")
elseif arg == "multiup" then
plr.Multi.Value += string.format('%.1f',math.random(0.05,0.1))
print("recieved data")
end
end)
For some reason, the output does print received data and all that, but the Multi value never goes above 1 inside of player. There are no errors, but it seems decimals don’t really work? Can someone help please?