#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)
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
The thing is that it's not parts it's just like time
I don't see the problem, then have some sort of Tick that adds points every x interval
I made it so every 5 seconds I get 1 point
that's great
But
then you solved your problem lol
What do you mean
Yes
okay how does your points logic look?
Should I send the script
ofc
"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
'''
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
oh
local playerList = Players:GetPlayers()
don't do that
Oh wait this is in a while loop
then yeah it does not matter then
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
so like player.character.humanoid.walkspeed +1?
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
so i just copy paste that? and it should work?
read.
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?
addubg abd yeah almost
player.Character.humanoid.Walkspeed += 1
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
** You are now Level 2! **
it goes to 1 and stays at 1
i did that
but its not working still
@slow glade
capitalize Humanoid
player.Character.Humanoid
It's not working maybe something else in my script is broken now
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?