local sound = game.SoundService.Sound while true do sound:Play() wait(sound.TimeLength) local exp=Instance.new("Explosion") exp.Position=script.Parent.Position exp.Parent=workspace exp.BlastRadius = 20000 exp.BlastPressure = 100000000 game.Players.LocalPlayer.leaderstats.ThanosCoin = game.Players.LocalPlayer.leaderstats.ThanosCoin + 10 end
this is what i made i think i need to use remote events but i dont know how?
To use remote events you need a localscript and a global script and a remote
add a remote event to replicated storage as well named AddThanosCoin
Local Script
local sound = game.SoundService.Sound while true do sound:Play() wait(sound.TimeLength) local exp=Instance.new("Explosion") exp.Position=script.Parent.Position exp.Parent=workspace exp.BlastRadius = 20000 exp.BlastPressure = 100000000 game.ReplicatedStorage.AddThanosCoin:FireServer() end
Server Script
game.ReplicatedStorage.AddThanosCoin.OnServerEvent:Connect(function(plr) game.Players[plr].leaderstats.ThanosCoin = game.Players[plr].leaderstats.ThanosCoin + 10 end