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

ServerScriptService.Remotes:31: attempt to compare string with number (What did I do wrong?)

Here is my code...

local replicatedStorage = game:GetService("ReplicatedStorage") local starterRebirthAmount = 2000

local player = game.Players.LocalPlayer local mainFrame = script.Parent:WaitForChild("MainFrame") local rebirthMenu = mainFrame:WaitForChild("RebirthMenu") local mainButton = script.Parent:WaitForChild("MainButton") local rebirthButton = rebirthMenu:WaitForChild("RebirthButton") local strengthToRebirth = rebirthMenu:WaitForChild("StrengthToRebirth") local rebirths = player:WaitForChild("leaderstats").Rebirths

strengthToRebirth.Text = "You need at least "..math.floor((starterRebirthAmount + (rebirths.Value)* math.sqrt(1.5))).." strength to rebirth"

mainButton.MouseButton1Click:Connect(function() mainFrame.Visible= not mainFrame.Visible end)

rebirthButton.MouseButton1Click:Connect(function() local result = replicatedStorage.Remotes.Rebirth:InvokeServer ()

if result == true then
	rebirthButton.Text = "Rebirth Successful!"
	wait(1)
	rebirthButton.Text = "CLICK HERE TO REBIRTH"
elseif result == "NotEnoughStrength" then
	rebirthButton.Text = "Not strong enough!"
	wait(1)
	rebirthButton.Text = "CLICK HERE TO REBIRTH"
end

end)

rebirths:GetPropertyChangedSignal("Value"):Connect(function() strengthToRebirth.Text = "You need at least "..math.floor((starterRebirthAmount + (rebirths.Value)* math.sqrt(1.5))).." strength to rebirth" end)

Specifically on liine 20 is where it says ServerScriptService.Remotes:31: attempt to compare string with number. Yes, this is from the alvinblox video, I did exactly what I did, yet I get the error message. . Please help, thanks :))

1 answer

On the video check out the time 9:51, should help you out..

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