#AutoClicker

1 messages · Page 1 of 1 (latest)

lilac imp
#

So i followed the guide word for word, or so i thought but his work my dont
pls help

#

while true do
isSecond = not isSecond
for _, player in Players:GetPlayers() do
local profile = PlayerData.Profiles[player]
if not profile then continue end

    local isRegularActive = profile.Data.Auto.Regular.Active
    local regularDuration = profile.Data.Auto.Regular.Duration
    local isFastActive = profile.Data.Auto.Fast.Active
    local fastDuration = profile.Data.Auto.Fast.Duration

    if isFastActive then 
        PlayerData.AdjustClicks(player, 1)

        if isSecond then
            profile.Data.Auto.Fast.Duration -=1
        end

        if profile.Data.Auto.Fast.Duration <= 0 then
            profile.Data.Auto.Fast.Active = false 
            Remotes.UpdateAutoClicker:FireClient(player, "Fast", false)
        end
    end

    if isSecond and isRegularActive then
        PlayerData.AdjustClicks(player, 1)
        profile.Data.Auto.Regular.Duration -=1

        if profile.Data.Auto.Regular.Duration <= 0 then
            profile.Data.Auto.Regular.Active = false 
            Remotes.UpdateAutoClicker:FireClient(player, "Regular", false)
        end
    end

    task.wait(.5)
end

end

torn depot
#

why is it in a while true loop 😭

torn depot
#

cuz like 4 variables are not assigned

lilac imp
#

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

local Remotes = ReplicatedStorage.Remotes
local PlayerData = require(ServerScriptService.PlayerData.Manager)

local function UpdateAutoClicker(player: Player, buttonType: "Fast" | "Regular")
local profile = PlayerData.Profiles[player]
if not profile then return end

local isActive = profile.Data.Auto[buttonType].Active
local duration = profile.Data.Auto[buttonType].Duration

if isActive then
    profile.Data.Auto[buttonType].Active = false
    Remotes.UpdateAutoClicker:FireClient(player, buttonType, false)
elseif not isActive and duration > 0 then
    profile.Data.Auto[buttonType].Active = true
    Remotes.UpdateAutoClicker:FireClient(player, buttonType, true)
end

end

Remotes.UpdateAutoClicker.OnServerEvent:Connect(UpdateAutoClicker)

local isSecond = false

#

this goes before it.

lilac imp
torn depot
#

or ProfileStore wtv you use

#

you should not follow tutorials that use such advanced stuff wehn ur a beginner

lilac imp
#

...

viral mountainBOT
#

studio** You are now Level 3! **studio

torn depot
#

You are just not gonna learn how to code things yourself like this, we could figure out why it won't work but after that something else will also not work and ts will just repeat over and over again

lilac imp
#

i already spent like days in this project. im not going to stop now.
I cant.

torn depot
#

🤷‍♂️

lilac imp
#

i got it work!, silly mistakes as always

torn depot
#

nice

lilac imp
#

chatgpt for the save 🙂

deft pollen
#

you don't learn anything if u just get spoonfed code

arctic hill
#

@lilac imp Firstly don't listen to him, try and fail a million times, that's how you learn. As for your code if it's working now great!

lilac imp
#

Thanks for the motivation 😁

torn depot
arctic hill
#

Chatgpt is an amazing tutor, if you're new and have no idea where to start and it's simple code asking chatgpt to fix it is a valuable way to learn how to recognize what's wrong with code

#

Dismissing it entirely is an amazing way to end up in the past.

raven gate
torn depot
raven gate
#

Probably was a typo or something since it was "A sily mistake"

torn depot
#

i would bet that he doesn't know what is going on 90% of his code

raven gate
#

Tutorials are the worst way to learn.

#

Docs & Scripting stuff your self is the best way.

#

and ai

torn depot
#

Yes thats also the reason why AI in this scenario isn't useful, because even if it explains what is wrong he will not understand cause it's too complex for beginners

torn depot
lilac imp
#

i mean code nowadays is pretty much english.
its just idk i woudnt know how to start myself but i could explain a piece of code
if were quite simple.

torn depot
#
local framework = require(script.framework)
framework.init()

what abt this

lilac imp
#

so i havent used it before but

u created a local variable called framework

the "require" part idk

but from my previous coding the "script.framework" you are going inside a function or smth, idk how to explain it.
ex u have "profile.Data.Auto.Fast.Active = false "

here you have profile which has the Data..

and the last part ur just running it i think but idk what init is

arctic hill
#

What he did was similar but for module scripts

lilac imp
#

see i have no clue what a framework actually is..

#

i have never used it.

torn depot
lilac imp
#

😭 😭

torn depot
lilac imp
#

🥴

arctic hill
#

A framework in real world terms is pointless on Roblox as studio is a game engine

#

In roblox terms, is a collection of code the runs the game on module scripts

#

That*

lilac imp
#

i see i see.

#

like u have windows frame work

torn depot
lilac imp
#

well the . means its a path

#

and thats all ik

torn depot
#

i guess you could put it like that

viral mountainBOT
#

studio** You are now Level 28! **studio