#How can I get a ServerScript to not be shared with multiple players?

1 messages · Page 1 of 1 (latest)

plain crown
#

I want each player to have the ability to use their abilities instead of only one player using and being taken by others

The video will show you what exact problem I am talking about.

#

Player1 were able to spawn the ability until Player2 used it and now Player1 can't even do much

#

I need help on solving this issue matter

vale hare
#

??

warped agate
#

So we remaking slap battles

vale hare
warped agate
#

But u need a local script to have the player do something by their self

#

And then send that to the server

#

I’m actually not quite sure how this is working

plain crown
plain crown
warped agate
#

I’m confused u must be sending something to the server that sends something back to the client to add a cooldown

plain crown
#

the cooldown is only in localscript, serverscript has nothing to do with the cooldown

#

the server's job is to only spawn the ability and throw them, and that's it

#

do you need to see what a LocalScript is like?

warped agate
#

Yea

plain crown
# warped agate Yea
    local AbilityUI = PlayerGUI:WaitForChild("EButton")
    
    Tool.Equipped:Connect(function()
        OnEquip = true
    end)
    
Tool.Unequipped:Connect(function()
    OnEquip = false
end)


    AbilityUI.Frame.Button.Activated:Connect(function(player)
        if AbilityDB == false then
            if OnEquip == true then
            AbilityDB = true
            CooldownUiModule.New(plr, AbilityName, Cooldown)
            game.ReplicatedStorage:WaitForChild("AbilityActivation"):FireServer()
                task.delay(Cooldown.Value, function()
                    AbilityDB = false
                    end)
            end
        end
    end)

UserInput.InputBegan:Connect(function(input)
        if input.KeyCode == Enum.KeyCode.E then
            
        if UserInput:GetFocusedTextBox() == nil then
            if OnEquip == true then
                if AbilityDB == false then
                    AbilityDB = true
                    CooldownUiModule.New(plr, AbilityName, Cooldown)
                        game.ReplicatedStorage:WaitForChild("AbilityActivation"):FireServer()
                        
                    task.delay(Cooldown, function()
                            AbilityDB = false
                        end)
                   end
                end
            end
        end
    end)
end```
#

the cooldown contains a IntValue

warped agate
#

Can u maybe send it in a screen shot cuz I’m on phone and it’s really hard for me to read

#

Cuz it’s all sideways and I colored

plain crown
#

actually never mind, I think I just figured it out

#

all I had to do was add "player = player"

warped agate
#

Alrighty cool man

plain crown
#

yeah sorry

upper juniperBOT
#

studio** You are now Level 5! **studio