Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is there a way to change a variable through a bindable event?

 remote.Event:Connect(function(playerName)
    local value = math.random(1, 35)
    local location = game.ReplicatedStorage.PlayerInventories.playerName
    location.otherValues.powerMastery.Value = value
    local value = math.random(1,7)
    location.otherValues.formMastery.Value = value
    end) 

I'm pretty new to scripting, and I just started using Bindable events. I want to change the location variable to have the players name on the end so I can refrence the players inventories

2 comments

0

Can you format that properly by pressing the Lua button?

0

whoops

1 answer

remote.Event:Connect(function(playerName)
   local value = math.random(1, 35)
   local location = game.ReplicatedStorage.PlayerInventories[playerName]
   location.otherValues.powerMastery.Value = value
   local value = math.random(1,7)
   location.otherValues.formMastery.Value = value
end)

Heres the asnwer for future players, courtesy of Practera#3811

This discussion is preserved as it was. New answers, comments, and votes are closed.