I tried to fire a remote event after 5 seconds but it didn't seem to work. I tried using print to debug it and still
these are all my script involving this problem
--spawner Local script local button = script.Parent --your textbutton local remote = game.ReplicatedStorage:WaitForChild("Reemote") button.MouseButton1Click:Connect(function() remote:FireServer() end)
-
--weapon Local script local button = script.Parent --your textbutton local weaponRemote = game.ReplicatedStorage:WaitForChild("WeaponEvent") button.MouseButton1Click:Connect(function() wait(5) --this is the problem weaponRemote:FireServer() end)
-
--weaponscript local famas = game.ReplicatedStorage.FAMAS local scarL = game.ReplicatedStorage["SCAR-L"] local famasClone = famas:Clone() local scarLClone = scarL:Clone() local remote = Instance.new("RemoteEvent") remote.Parent = game.ReplicatedStorage remote.Name = "WeaponEvent" remote.OnServerEvent:Connect(function(plr) famasClone.Parent = plr.Backpack scarLClone.Parent = plr.Backpack print("weaponscript activated") end)
-
--Spawnscript math.randomseed(tick()) local remote = Instance.new("RemoteEvent") remote.Parent = game.ReplicatedStorage remote.Name = "Reemote" local spawns = workspace.Spawns:GetChildren() -- a model of all the spawn bricks remote.OnServerEvent:Connect(function(plr) plr:LoadCharacter() local PlayerSpawn = spawns[math.random(1,#spawns)] plr.Character:SetPrimaryPartCFrame(CFrame.new(PlayerSpawn.Position.X,PlayerSpawn.Position.Y + 5,PlayerSpawn.Position.Z)) print("spawn script activated") end)
the output will be like this
weaponscript activated
spawn script activated
where the weapon script got activated first