Scripting Helpers is winding down operations and is now read-only. More info→
Log in to vote

How do I update the Player's Avatar without Resetting if I'm using a StarterCharacter?

Asked by 1 year ago

In my game, blood splatters are supposed to appear on the Player when they kill an NPC. These blood splatters are parts on the Player's StarterCharacter. On the parts are decals for the blood and their transparency is set to 1.

In this script, it's supposed to set the Transparency of the Blood Splatter Decals to 0 when the Player triggers the ProximityPrompt to kill an NPC. But the problem is, when the ProximityPrompt is triggered, the blood doesn't immediately appear. The Player has to reset in order for the blood to appear. I don't want the Player to have to reset so I need help modifying my script to make the blood splatters appear immediately when the ProximityPrompt is triggered. Here is the script:

local ProximityPrompt = script.Parent
Player = game.Players.LocalPlayer

    game.Workspace[" "].Humanoid.Health = 0
    game.Workspace[" "].KillPrompt:Destroy()
    game.Workspace[" "].ChatPrompt:Destroy()
    game.Workspace[" "].DragPrompt.DragCorpsePrompt.Enabled = true

    game.StarterPlayer.StarterCharacter.Splatter1["Blood Splatter 1"].Transparency = 0
    game.StarterPlayer.StarterCharacter.Splatter2["Blood Splatter 1"].Transparency = 0
    game.StarterPlayer.StarterCharacter.Splatter3["Blood Splatter 1"].Transparency = 0
    game.StarterPlayer.StarterCharacter.Splatter4["Blood Splatter 1"].Transparency = 0
    game.StarterPlayer.StarterCharacter.Splatter5["Blood Splatter"].Transparency = 0
    game.StarterPlayer.StarterCharacter.Splatter6["Blood Splatter"].Transparency = 0
    game.StarterPlayer.StarterCharacter.Splatter7["Blood Splatter"].Transparency = 0
    game.StarterPlayer.StarterCharacter.Splatter8["blood splatter1"].Transparency = 0

The "game.StarterPlayer.StarterCharacter.Splatter" parts are the ones you want to look at. If anyone has any ideas, that would be greatly appreciated!

Use Player.Character instead of game.StarterPlayer.StarterCharacter T3_MasterGamer 2189 — 1y

Answer this question