Code:
local plr = game.Players.LocalPlayer local uis = game:GetService("UserInputService") local db = false local trackerdb = false wait(4) local RE = script.Parent.Diref uis.InputBegan:Connect(function(input, IsTyping) if IsTyping then return end if input.KeyCode == Enum.KeyCode.G then if db == true then return end db = true local tracker = Instance.new("IntValue") tracker.Parent = script tracker.Value = 0 if tracker.Value == 0 then tracker.Value = 1 else tracker.Value = 0 end if plr.Data.Makiko.Value >= 40 and plr.Data.LeftMaina.Value >= 20 then RE:FireServer(tracker) end if tracker.Value == 1 then while true do if trackerdb == true then return end trackerdb = true if plr.Data.LeftMaina.Value >= 20 then plr.Data.LeftMaina.Value = plr.Data.LeftMaina.Value - 20 end wait(2) trackerdb = false end end end end)
In this local script, I tried to fire the value of tracker in a remove event, but when I tried to get the value of tracker in the real script, it says tracker is nil
It's because you're firing the remote with the IntValue itself, which is a local instance visiblw only to you. You should fire its value instead, like RE:FireServer(tracker.Value)
, or refrain from using it and replace it with a normal variable.