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

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

Asked by 8 years ago

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)
0
Where is line 14 here? Perci1 4988 — 8y
0
for i = 0, 1, 0.06 do thats what line 14 is but it doesn't have anything about name RetroThieff 5 — 8y
0
I'm thinking its line 39 and under RetroThieff 5 — 8y
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. Perci1 4988 — 8y
View all comments (5 more)
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. RetroThieff 5 — 8y
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. HungryJaffer 1246 — 8y
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? RetroThieff 5 — 8y
0
There we go I replaced it RetroThieff 5 — 8y
0
Line 14 is line 12 on this version. RetroThieff 5 — 8y

2 answers

Log in to vote
0
Answered by 8 years ago
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
0
Man, how did one little script he asked made it into a long script RobotChitti 167 — 8y
0
He changed the script. HungryJaffer 1246 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

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)

Answer this question