Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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

Log in to vote
0
Answered by
0_2k 496 Moderation Voter
4 years ago

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

Ad

Answer this question