#Help with a simulator, i suck so bad
1 messages · Page 1 of 1 (latest)
** You are now Level 1! **
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
Thanks
Would I put this in ServerScriptService
?
this isnt gonna work if you just copy and paste it, add the stuff you need to it and then put it wherever you think it should go
I meant I know how to rename the functions, but would the sscript go into serverscriptservicece?
@shrewd obsidian ?
its probably going to either be a local script or a remote event reciever so its up to you on what to do with it
its not a full script
Ok
its psuedocode if you cant code at ALL then you should research a bit more before making something
@shrewd obsidian I don't know what I know so i either probably know psuedocode or not
the code is incomplete you can either finish it yourself or skid something
this help place is more for if you can code and find an issue, its not as good if you cant code at all
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?
if you want to learn to code first learn the FUNDAMENTALS, after you learn the fundamentals the rest will come very easily
if you try skipping to advanced things you wont be able to actually write code
coding is all basics
Would you say the fundamentals are like the variables, terms, and logic?
** You are now Level 2! **
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
variables, syntax, and general skill on how to make basic things
coding is all math and other basic shit
ohh
roblox has UserInputService
ye
seee
i told u
idk what i know and dont know
I know that userinputservice is already there
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
@shrewd obsidian where do you suggest learning it?
where did you start?
any help is good
i suggest learning the basics and syntax just by using the lua docs or youtube tutorials, i learned by learning the basics of lua and then writing code myself and just googling issues i came across which helped me know errors and how to stop running into them
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