Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago
 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

0
Can you format that properly by pressing the Lua button? youtubemasterWOW 2741 — 4y
0
whoops Feroxidus 83 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
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

Ad

Answer this question