#Values arent changing correctly

97 messages · Page 1 of 1 (latest)

flat monolith
#
game.Players.PlayerAdded:Connect(function(plr)
game.ReplicatedStorage.StatSystem.AddingStats.AddingMelee.OnServerEvent:Connect(function(plr)
        print("Yes")
        
        local PointsAvailable = plr.Stats.PointsAvailable
        local PointsUsed = plr.Stats.PointsUsed
        local Melee = plr.Stats.Melee
        
        if PointsAvailable.Value >= PointsUsed.Value then
            print("Points is more")
            Melee.Value = Melee.Value + PointsUsed.Value
            PointsAvailable.Value = PointsAvailable.Value - PointsUsed.Value
            print("Melee Up Normal")

        else
            print("Points is less")

            Melee.Value = Melee.Value + PointsAvailable.Value
            PointsAvailable.Value = PointsAvailable.Value - PointsAvailable.Value
            print("Points up all")
            end
            end)
        end)
#

Current code

#

It should be increasing melee by the peramaters

flat monolith
#

?

#

Huh?

azure wraith
#

All players are affected by one player's action

#

Oh, mobile moment. You're safe for now

flat monolith
#

Thats not even the issue im having, but good to know

azure wraith
#

It was very close.

flat monolith
#

I see

azure wraith
#

Get rid of that goofy Players.PlayerAdded handler

azure wraith
flat monolith
#

I see

#

Isnt the issue with the script tho

azure wraith
flat monolith
#

A what?

azure wraith
#

A memory leak is when a program fails to release the memory it no longer needs

#

You've technically got memory bloat, too

#

Two for two, lol

flat monolith
#

Well what am i supposed to do?

#

Because im confused

#

Rn its doing nothing at all

#

besides print "Points is more" and "melee up normal" No matter what pointsused is

azure wraith
flat monolith
#

I removed that and nothing happened

azure wraith
flat monolith
#

I see

azure wraith
#

That's probably because you're manipulating those values locally

flat monolith
#

Then how do i fix both problems?

flat monolith
#

Idk how to do thta

flat monolith
azure wraith
#

None of those values can be changed in a LocalScript

flat monolith
#

This isnt a local script

azure wraith
#

Those changes will fail to replicate due to the replication boundary

flat monolith
#

Again, not a localscript

azure wraith
flat monolith
#

Ah

azure wraith
#

The system(s) you have to progress those values is what I'm referring to

flat monolith
#

Im confused

#

Im not very good at lua just trying to make a first simple game

azure wraith
#

Give this a read

flat monolith
#

I dont understand any of it

azure wraith
#

Break it down; research what you don't understand in that article until you can work back up to it

#

The client-server model is a fundamental component of multiplayer games

#

You must understand this model in order to develop on Roblox

flat monolith
#

Bro im just trying to fix this one issue rn

#

Not learn everything

azure wraith
#

The problem is caused by your lack of understanding in the client-server model

#

You don't seem to understand the replication boundary, and the roles of Scripts and LocalScripts

flat monolith
#

Idk what that even is

azure wraith
flat monolith
#

?

#

Im confused

azure wraith
#

About?

flat monolith
#

just all ofi t

azure wraith
#

Here's a video to dumb things down

flat monolith
#

I still dont get it

azure wraith
flat monolith
#

I did

#

I dont get it tho

#

Can u help me fix it tho? Cuz i learn more by doing then by being taught

azure wraith
flat monolith
#

No not very

azure wraith
flat monolith
#

?

flat monolith
#

I watched all of it

azure wraith
#

You watched an ~20-minute video in the span of 5 minutes?

flat monolith
#

By skimming yes, because as I said, I dont learn by being taught

#

I learn by doing it

azure wraith
#

Cope. Watch the whole video

flat monolith
#

No

azure wraith
#

Then you're on your own, lmfao

flat monolith
#

Ok then

#

Your useless

#

Get out of here

#

Get

#

Just leave

#

go

#

Stop following it

#

Goodbye

tardy sapphire
flat monolith
#

Xd*

tardy sapphire
#

🤯

#

😱

flat monolith
#

He was useless

#

Was spitting facts

tardy sapphire
#

im useless