i am having trouble in here.
I tried to make it drop out of a NPC, but it works with all players.
the NPC I want the item to fall from's name is 'King Cake'(location:game.workspace)
the item I want it to make it drop from KingCake on death name is 'Chest1'(location:game.ReplicatedStorage)
my script appears to work on all players(it works in ROBLOX Studio, but not in the real game. Why?)
script info:
LocalScript(name:LocalScriptKC)(location:StarterGui)
my script:
local part = game.ReplicatedStorage.Chest1 --name of my thing
local plr = game.Players.LocalPlayer
local character = plr.Character
local humanoid = character.Humanoid
humanoid.Changed:connect(function()
if humanoid.Health <= 0 then
local clone = part:Clone()
clone.Parent = workspace
clone.Body.Position = character["Torso"].Position +
Vector3.new(math.random(-5, 5), 0, math.random(-5, 5))
clone.Body.Rotation = Vector3.new(math.random(10, 100), 0, math.random(10, 100))
end
end)
please help me. thanks
(sorry for bad grammar)

4 comments
Is the game filtering enabled?
no
did you use game:GetService("ReplicatedStorage")
no, i used 'local part = game.ReplicatedStorage.Chest1 --this is the name of the item i want it to drop when kingcake npc dies.