#I'm trying to make a game but I want to turn points into speed, how do I do this?

61 messages · Page 1 of 1 (latest)

slow glade
#

oh you can simply add +1 to the character humanoid walskpeed property!!!

#

if the points are parts you can simply use the touched event of the part

#

and on touched

  • get the humanoid from the touched part (if it exists)
  • add +1 to it's walkspeed
ivory violet
#

The thing is that it's not parts it's just like time

slow glade
ivory violet
#

I made it so every 5 seconds I get 1 point

slow glade
#

that's great

ivory violet
#

But

slow glade
#

then you solved your problem lol

ivory violet
#

How do I turn those points into speed

#

I'm new to scripting

slow glade
#

you have access to them don't you?

#

and this applies to all players

#

I pressume

ivory violet
#

What do you mean

slow glade
#

that this points things apply to all players, right?

#

points to speed

ivory violet
#

Yes

slow glade
#

okay how does your points logic look?

ivory violet
#

Should I send the script

slow glade
#

ofc

ivory violet
#

"local Players = game:GetService("Players")

local function onPlayerAdded(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player

local Speed = Instance.new("IntValue")
Speed.Name = "Speed"
Speed.Value = 0
Speed.Parent = leaderstats

end

Players.PlayerAdded:Connect(onPlayerAdded)
while true do
wait(5)
local playerList = Players:GetPlayers()
for currentPlayer = 1, #playerList do
local player = playerList[currentPlayer]
local Speed = player.leaderstats.Speed
Speed.Value = Speed.Value + 1
end
end
"

#

"'local Players = game:GetService("Players")

local function onPlayerAdded(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player

local Speed = Instance.new("IntValue")
Speed.Name = "Speed"
Speed.Value = 0
Speed.Parent = leaderstats

end

Players.PlayerAdded:Connect(onPlayerAdded)
while true do
wait(5)
local playerList = Players:GetPlayers()
for currentPlayer = 1, #playerList do
local player = playerList[currentPlayer]
local Speed = player.leaderstats.Speed
Speed.Value = Speed.Value + 1
end
end
'''

slow glade
#
local Players = game:GetService("Players")

local function onPlayerAdded(player)
    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player

    local Speed = Instance.new("IntValue")
    Speed.Name = "Speed"
    Speed.Value = 0
    Speed.Parent = leaderstats
end

Players.PlayerAdded:Connect(onPlayerAdded)
while true do
    wait(5)
    local playerList = Players:GetPlayers()
    for currentPlayer = 1, #playerList  do
        local player = playerList[currentPlayer]
        local Speed = player.leaderstats.Speed
        Speed.Value = Speed.Value + 1
    end
end
"
#

you're using quotes

#

not backticks

ivory violet
#

oh

slow glade
#
    local playerList = Players:GetPlayers()
#

don't do that

#

Oh wait this is in a while loop

#

then yeah it does not matter then

ivory violet
#

yea

#

its loop

slow glade
#
while true do
    wait(5)
    local playerList = Players:GetPlayers()
    for currentPlayer = 1, #playerList  do
        local player = playerList[currentPlayer]
        local Speed = player.leaderstats.Speed
        Speed.Value = Speed.Value + 1
    end
end

I mean this fine 🤔

#
while true do
    wait(5)
    local playerList = Players:GetPlayers()
    for currentPlayer = 1, #playerList  do
        local player = playerList[currentPlayer]
        local Speed = player.leaderstats.Speed
        Speed.Value = Speed.Value + 1

        -- get the player character humanoid here and add +1 to the humanoid walspeed property
    end
end
#

there the comment explains

#

to help you a bit

ivory violet
#

so like player.character.humanoid.walkspeed +1?

slow glade
#
while true do
    wait(5)
    local playerList = Players:GetPlayers()
    for currentPlayer = 1, #playerList  do
        local player = playerList[currentPlayer]
        local Speed = player.leaderstats.Speed
        Speed.Value = Speed.Value + 1
      
        local Character = currentPlayer.Character
        if not Character then continue end --> cause the character is not guaranteed to be there!
        -- get humnanoid
        -- offset humanoid's walkspeed
    end
end
ivory violet
#

so i just copy paste that? and it should work?

slow glade
#

read.

ivory violet
#

wdym offset

#

im not english sorry

#
    wait(5)
    local playerList = Players:GetPlayers()
    for currentPlayer = 1, #playerList  do
        local player = playerList[currentPlayer]
        local Speed = player.leaderstats.Speed
        Speed.Value = Speed.Value + 1

        local Character = currentPlayer.Character
        if not Character then continue end --> cause the character is not guaranteed to be there!
        -- get humnanoid
        player.Character.humanoid.Walkspeed +1
    end
end```
#

like this?

slow glade
#

player.Character.humanoid.Walkspeed += 1

ivory violet
#

Hmm

#

It doesn't seem to work

#

local function onPlayerAdded(player)
    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player

    local Speed = Instance.new("IntValue")
    Speed.Name = "Speed"
    Speed.Value = 0
    Speed.Parent = leaderstats
end

Players.PlayerAdded:Connect(onPlayerAdded)
while true do
    wait(5)
    local playerList = Players:GetPlayers()
    for currentPlayer = 1, #playerList  do
        local player = playerList[currentPlayer]
        local Speed = player.leaderstats.Speed
        Speed.Value = Speed.Value + 1

        local Character = currentPlayer.Character
        if not Character then continue end --> cause the character is not guaranteed to be there!
        -- get humnanoid
        player.Character.humanoid.Walkspeed += 1
    end
end
``` this is what i have now but its not working
#

on the leaderbaord it says 1 speed and it also stays on 1 speed but my walkspeed is just the normal

#

hm its not looping anymore

split basinBOT
#

studio** You are now Level 2! **studio

ivory violet
#

it goes to 1 and stays at 1

ivory violet
#

but its not working still

ivory violet
#

@slow glade

sterile compass
#

player.Character.Humanoid

ivory violet
ivory violet
# sterile compass capitalize Humanoid

local function onPlayerAdded(player)
    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player

    local Speed = Instance.new("IntValue")
    Speed.Name = "Speed"
    Speed.Value = 0
    Speed.Parent = leaderstats
end

Players.PlayerAdded:Connect(onPlayerAdded)
while true do
    wait(5)
    local playerList = Players:GetPlayers()
    for currentPlayer = 1, #playerList  do
        local player = playerList[currentPlayer]
        local Speed = player.leaderstats.Speed
        Speed.Value = Speed.Value + 1
        local Character = currentPlayer.character
        if not Character then continue end
        player.Character.Humanoid.Walkspeed += 1
    end
end``` this is what i have rn, do you see anything wrong?