local Char = game:GetService("Players").LocalPlayer.CharacterAdded:Wait()
Char.Humanoid.Died:Connect(function()
game.ReplicatedStorage.Bobux:FireServer(Char)
end)
for some reason it isn’t working. I have a part called bobux in replicated storage the the script is a local and is inside of the workspace. I think the script may be outdated since I got it from a tutorial.
This may be due to the fact that you’re only detecting for a CharacterAdded event, & not for a Character property of the player as well
Try this?
local Player = game.Players.LocalPlayer
local Char = Player.Character or Player.CharacterAdded:Wait()
Char.Humanoid.Died:Connect(function()
game.ReplicatedStorage.Bobux:FireServer(Char)
end)
FireServer is not an event of a Model, you have to use a RemoteEvent or change the name of your Model (You can’t just name them the same way if you’re getting some kind of error)
Ok the script that you have right now, is detecting for the Part but not the RemoteEvent
Just change your code to this:
local Player = game.Players.LocalPlayer
local Char = Player.Character or Player.CharacterAdded:Wait()
Char.Humanoid.Died:Connect(function()
--game.ReplicatedStorage.Bobux:FireServer(Char) --Don't use this, this is referring to the Part Instance which "FireServer()" is not a function
game.ReplicatedStorage.RemoteEvent:FireServer(Char) --Use this line, this is valid
end)
okay. heres more information. Im making a part which is currently in replicated storage called bobux. I’m trying to make it so when you die it drops. The issue is that its not working.
I don’t have much information since its a small issue.