#Help with a simulator, i suck so bad

1 messages · Page 1 of 1 (latest)

latent belfry
#

how can i create a speed system where when we go forward, we get speed over time?
I am literally a beginner scripter, but i know very SMALL basic knowledge, please help
maybe need help with scripting in general, how to start learning
please help

steep palmBOT
#

studio** You are now Level 1! **studio

shrewd obsidian
# latent belfry how can i create a speed system where when we go forward, we get speed over time...

create an isRunning boolean that is set to true when the player is moving, if the player stops moving for a certain amount of time it gets set to false, some basic psuedocode for this is

local isRunning = false;
local speed = 16; -- player speed blahblah
local increment = 3; -- per second or smth, you can make it exponential if you want

local onStart = function()
  isRunning = true;
  repeat task.wait(1); speed += increment; -- repeat increasing it every second while its true
  until isRunning = false;
end

local onStop = function()
  isRunning = false;
  speed = 16; -- or default walkspeed
end

-- when the player runs or smth
onStart();
-- when they stop
onStop();

#

do some research on how to find when the player starts and stops moving

#

i left that part out so you can actually learn

latent belfry
#

Thanks

latent belfry
#

?

shrewd obsidian
latent belfry
#

I meant I know how to rename the functions, but would the sscript go into serverscriptservicece?

#

@shrewd obsidian ?

shrewd obsidian
#

its not a full script

latent belfry
#

Ok

shrewd obsidian
#

its psuedocode if you cant code at ALL then you should research a bit more before making something

latent belfry
#

@shrewd obsidian I don't know what I know so i either probably know psuedocode or not

shrewd obsidian
#

this help place is more for if you can code and find an issue, its not as good if you cant code at all

latent belfry
#

I have been trying to code for 5 years

#

@shrewd obsidian

#

maybe exaggerated

#

idk where to start tho

#

Can you help me once and explain remoteevents?

shrewd obsidian
#

if you try skipping to advanced things you wont be able to actually write code

#

coding is all basics

latent belfry
#

Would you say the fundamentals are like the variables, terms, and logic?

steep palmBOT
#

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

latent belfry
#

Lua is a language by itself, but also needs to be adapted to for roblox?

#

I will tell you my ideas, and can yo confirm them plz

#

there will be a remote event in replicated storage

#

in starterplayerscripts, i would make a script that gets input from user

#

@shrewd obsidian

shrewd obsidian
#

coding is all math and other basic shit

latent belfry
#

ohh

shrewd obsidian
latent belfry
#

ye

#

seee

#

i told u

#

idk what i know and dont know

#

I know that userinputservice is already there

shrewd obsidian
#

just learn basic lua before learning about roblox services

#

do some math wiht lua and do some loops through tables

#

learn all the basic stuff

latent belfry
#

@shrewd obsidian where do you suggest learning it?
where did you start?
any help is good

shrewd obsidian
latent belfry
#

Ok

#

Thx

latent belfry
#

UserInputService = game:GetService("UserInputService")

UserInputService.InputBegan:Connect(function(input, output)
if input.KeyCode == Enum.KeyCode.W then
output = "Active"
print("active")
end
end)

UserInputService.InputEnded:Connect(function(input, output)
if input.KeyCode == Enum.KeyCode.W then
output = "Inactive"
print("inactive")
end
end)

#

I made the script for detecting walking forward, now can you help me find out what to do next?

#

I want to make it so walking forward gains speed over time