You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Make the correct global variable static -
What is the issue? Include screenshots / videos if possible!
Global variable is changing when it shouldn’t -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried freezing the table
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
KeybindReinstated.OnClientEvent:Connect(function(currentKeybinds)
_G.currentKeybinds = currentKeybinds
_G.legacyKeybinds = currentKeybinds
table.freeze(_G.legacyKeybinds)
for k, v in pairs(player.PlayerScripts.Settings.Keybinds:GetChildren()) do
if _G.currentKeybinds[v.Name] ~= nil then v.Value = _G.currentKeybinds[v.Name] end
end
local playerKeybindGui = player.PlayerGui:WaitForChild("Settings").SettingsGroup.KeybindToggles
for k,v in pairs(playerKeybindGui:GetDescendants()) do
if _G.currentKeybinds[v.Name] ~= nil then
v:WaitForChild("CurrentKB").Text = _G.currentKeybinds[v.Name]
end
end
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.