ok so im trying to run a remote event from a tool’s localscript to the server
the server-side code:
local debounce = {}
local repl = game:GetService("ReplicatedStorage")
local track
repl.Use.OnServerEvent:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local item = char:FindFirstChildOfClass("Tool")
if plr and not debounce[plr] then
debounce[plr] = plr
track = char.Humanoid:LoadAnimation(repl.Anims.Shake)
track:Play()
local sound = char[item.Name].Handle.Sound
sound:Play()
plr.playerstats.Coins.Value+=1
track.Stopped:Wait()
debounce[plr] = nil
end
end)
but it only works properly in single-player studio test for just me for some reason, and only for me not my friend or team-test for both of us or playing the game on its games page for either of us.
for when it doesn’t work, it only plays the sound and nothing else works.
the remote event still runs through even when it doesn’t work, i logged it and it still worked.
for some reason there are still no errors either which is strange