--When a player spawns, sets up stuff for them local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local function onCharacterAdded(player) local lobbyTeam = game.Teams.Lobby --Well use the player in Players cause Team is not a child of the player model local teamPlayer = Players:WaitForChild(player.Name) if teamPlayer.Team ~= lobbyTeam then local stick = ReplicatedStorage.HittingStick local stickClone = stick:Clone() stickClone.Parent = teamPlayer.Backpack stickClone.Handle.Anchored = false stickClone.Top.Anchored = false end end Players.LocalPlayer.CharacterAdded:Connect(onCharacterAdded)
This is just a checker local script for when people spawn, not actually that relevant. But maybe problem is in code.
Basically, in my undeveloped game, there are two team blocks and if you touch one it loads your character and then spawns you in the map. It gives you a fighting stick then. But when I send a stick clone into the player's inventory from ReplicatedStorage, the Animation Script inside it I use (local script) seems to work, but the script for other stuff like damage does not run from the start. Can somebody please help me as to where the problem lies. What storage or area.
A script located in ReplicatedStorage, ServerStorage, ReplicatedFirst, StarterPack, Teams and Lighting won't run. I recommend parenting the script to ServerScriptService and making it a server script instead of a local script which you can't use game.Players.LocalPlayer, If you don't know how to. You can use an on player added function, More about the on player added function here.
Hope I helped, Have a good day! :)
I would put the script in SSS (ServerScriptService) You could put it in workspace but not reccomended as it can be easily stolen. I would also use server scripts not local because local scripts do not work in SSS.
Like many of the other people said, I would also put the script in ServerScriptService. Use a server script if you are doing so. It is also recommended that you don't put the script in workspace.