Hi, i have a bug in a script that when eternitynum convert the value to 1000 to 1k after its stop to work because of an error :
ServerScriptService.ClickEvent:34: attempt to perform arithmetic (add) on string and number - Serveur - ClickEvent:34
script :
local event = game.ReplicatedStorage.Remotes.RemoteEvent
local petModule = require(game.ServerScriptService.PetMod)
local en = require(game.ServerScriptService.EternityNum)
local trainclick = {
["train1"] = 1,
["train2"] = 1,
["train3"] = 1,
["train4"] = 1,
["train5"] = 1,
["train6"] = 1,
["train7"] = 1,
["train8"] = 1
}
local animPlaying = {}
event.OnServerEvent:Connect(function(player, arg, amount)
if arg == "Click" and not animPlaying[player] then
local leaveButton = player.PlayerGui.Menu.Leave
local muscleValue = player.leaderstats.Muscle.Value
leaveButton.MouseButton1Click:Connect(function()
end)
local petboost = petModule.PetBoost(player)
local trainType = player:GetAttribute("Enable")
if trainclick[trainType] then
muscleValue += trainclick[trainType] * petboost
player.leaderstats.Muscle.Value = en.short(muscleValue)
end
local animationSpeed = 0.5 + (math.min(muscleValue ^ 0.25 / 20, 13))
animationSpeed = math.min(animationSpeed, 14)
animPlaying[player] = true
for i, v in pairs(player.Character.Humanoid:GetPlayingAnimationTracks()) do
v:Stop()
end
task.wait(0.001)
if player:GetAttribute("Enable") ~= "" then
local animationid = "rbxassetid://121846064478166"
local anim = Instance.new("Animation")
anim.AnimationId = animationid
local humanoid = player.Character:WaitForChild("Humanoid")
local animationTrack = humanoid:LoadAnimation(anim)
animationTrack:Play()
animationTrack:AdjustSpeed(animationSpeed)
animationTrack.Stopped:Connect(function()
local reverseAnim = Instance.new("Animation")
reverseAnim.AnimationId = "rbxassetid://113153233667550"
local reverseTrack = humanoid:LoadAnimation(reverseAnim)
reverseTrack:Play()
reverseTrack:AdjustSpeed(animationSpeed)
reverseTrack.Stopped:Connect(function()
animPlaying[player] = false
local animationid = "rbxassetid://86869288899495"
local anim = Instance.new("Animation")
anim.AnimationId = animationid
local humanoid = player.Character:WaitForChild("Humanoid")
local animationTrack = humanoid:LoadAnimation(anim)
animationTrack:Play()
end)
end)
end
end
end)
line 32 to 37 :
if trainclick[trainType] then
muscleValue += trainclick[trainType] * petboost
player.leaderstats.Muscle.Value = en.short(muscleValue)
end
(line 34 is muscleValue += trainclick[trainType] * petboost)
** You are now Level 4! **