First off, you can optimize your code in the following manner:
LocalScript:
if game.Players.LocalPlayer.TeamColor == BrickColor.new("Really black") then
game.ReplicatedStorage.buff:FireServer()
end
Server-side Script:
buff = game.ServerStorage.buff:Clone()
game.ReplicatedStorage.buff.OnServerEvent:Connect(function(player)
buff.Parent = player.Character
end)
It is not necessary to clone the "buff" model within the LocalScript, as it is never used (at least not in the given portion of the script.)
It would be much more effective to remove the 'name' argument altogether and do "buff.Parent = player.Character" on line 6 of the serverscript as 'player' is a reference to the Player object associated with the client that invoked the event. If you need the player's name in the future, simply use "player.Name"
The above code will still not "work" as you wish it to, because the model will only be parented to the character. In order to get it to position itself correctly and stay on the character's neck, you'll need to weld the model (Hint: Use the PrimaryPart) to the character's Torso or Head, depending on the desired effect. However, this forum is not for making scripts for people, so I'll just leave you with that.
Hopefully this will point you in the right direction. Best of luck.
3 comments
is it replicating at all?
Is it a custom or is it officially ROBLOX made?
You're missing end tags on both scripts