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

Workspace.GiveValues:14: attempt to call field 'Name' (a string value)?


game.Players.PlayerAdded:connect(function(player)
	
	
	local stats = Instance.new("IntValue", player)
	stats.Name = "leaderstats"
	
	
	local points = Instance.new("IntValue", stats)
	points.Name = "Points"
	
	local ingame = Instance.new("BoolValue", player)
	ingame.Name "InGame"
	
	
end)

9 comments

0

Where is line 14 here?

0

for i = 0, 1, 0.06 do thats what line 14 is but it doesn't have anything about name

0

I'm thinking its line 39 and under

0

No, i mean, look at your original code and look for line 14. Then tell me the corresponding line number for this code, since they aren't lining up obviously.

0

Sorry I'm pretty new at scripting what do you mean original code? Isn't this the original code? I have no other scripts in the game. Please don't get mad at me.

0

if this isn't a snippet of the script and it is the full script, that means we're getting the error from another script.

0

Oh you know what I did make a leaderboard script thats the problem but I still don't know how to fix it. Should I replace the script up there with the leaderboard one?

0

There we go I replaced it

0

Line 14 is line 12 on this version.

2 answers

✓ Accepted answer
minigames = game.Lighting.Minigames:GetChildren()
h = Instance.new("Hint", game.Workspace)

function removePlate()
    local plates = game.Workspace.DisappearingPlates.Plates:GetChildren()
    local ranNum1 = math.random(1,#plates)
    local ranNum2 = 1
    while ranNum1 == ranNum2 do
    local ranNum2 = math.random(1,#plates)
    wait(1)
    end
    local plateChosen = plates(ranNum1)
    local plateChosen2 = plates(ranNum2)
    for i = 0, 1, 0.06 do
        plateChosen.Transparency = i
        plateChosen2.Transparency = i
        wait(1)
    end
    plateChosen:Destroy()
    plateChosen2:Destroy()
end



while true do
    wait() --gotta have that
    if game.Players.NumPlayers > 1 then
        h.Text = "Deciding what game to play"
        wait(3)
        ranGame = math.random(1, #minigames)
        gameChosen = minigames[ranGame]
        h.Text = "Minigame chosen: " .. gameChosen.Name
        wait(3)
        gameChosenClone = gameChosen:Clone()
        gameChosenClone.Parent = game.Workspace
        wait(3)
        --Teleporting players to map
        spawns = gameChosenClone.Spawns:GetChildren()
        for i,v in pairs(game.Players:GetPlayers()) do
            check = v.Character -- I'm guessing it that had to do with something from here, so instead of finding the player's name in workspace, I just directly pulled the character from player using Character.
            if check then
                checkHumanoid = check:FindFirstChild("Humanoid")
                if checkHumanoid then
                    v.Character:MoveTo(spawns[i].Position)
                end
            end 
        end
        for i = 3, 1, -1 do
            h.Text = "Game begins in: " .. i
            wait(1)
        end
        if gameChosenClone.Name == "DisappearingPlates" then
        timeTillGameEnds = 20
        --Countdown until the game ends
        for i = timeTillGameEnds, 1, -1 do
            h.Text = "Time Left: " .. i
            removePlate()
        end

    else
        h.Text = "There needs to be more than 1 player to start"
        wait(1)
    end

end



end

2 comments

0

Man, how did one little script he asked made it into a long script

0

He changed the script.

I fixed it. I just forgot an equal sign in there

-- Made by RetroThieff

game.Players.PlayerAdded:connect(function(player)
	
	
	local stats = Instance.new("IntValue", player)
	stats.Name = "leaderstats"
	
	
	local points = Instance.new("IntValue", stats)
	points.Name = "Points"
	
	local ingame = Instance.new("BoolValue", player)
	ingame.Name = "InGame"
	
	
end)

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