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

It says "cash is not a valid member of IntValue" Can someone help me fix it?

Asked by 6 years ago
Edited 6 years ago

Here is my code:

local replicatedstorage = game:GetService('ReplicatedStorage') local status = replicatedstorage:WaitForChild('InfoValue')while true do local mapstorage = game.Workspace:WaitForChild('mapStorage')

while game.Players.NumPlayers < 1 do
    status.Value = 'There is not enough players to begin'
    repeat wait(2) until game.Players.NumPlayers > - 1
end

for i =30,0,-1 do
    status.Value = 'Intermission: '..i
    wait(1)
end

local mapsinserverstorage = game:GetService('ServerStorage'):GetChildren()
local chosenmap = mapsinserverstorage[math.random(1, #mapsinserverstorage)]
chosenmap:Clone().Parent = mapstorage
status.Value = 'Get ready to be teleported!'
wait(3)
local spawns = chosenmap:WaitForChild('Spawns') :GetChildren()
for _, player in pairs (game.Players:GetPlayers()) do
    if player and #spawns > 0 then
        local torso = player.Character:WaitForChild('HumanoidRootPart')
        local allspawns = math.random(1, #spawns)
        local randomspawn = spawns [allspawns]
        if randomspawn and torso then
            table.remove (spawns, allspawns)
            torso.CFrame = CFrame.new (randomspawn.position + Vector3.new(0,2,0))

            local sword = game.ReplicatedStorage.Sword
            local newsword = sword:Clone()
            newsword.Parent = game.Workspace.SwordPutHere
     end                
end     
end      
for i = 10,0,-1 do
    if i == 0 then
        status.Value = 'Round over!'
        for _, player in pairs (game.Players:GetPlayers()) do
            if player:FindFirstChild ('leaderstats') then
                player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + 2
            end
        end
        break
        else
    end
    wait(1)
end 

mapstorage:ClearAllChildren() end

0
It means that IntValue cant use cash because its a value then you would do [Value Name(IntValue)].Value = [Your number here] VenomiZeD_VamqireXz 111 — 6y

Answer this question