Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to affect player character scripts?

I want to apply edited animate and sound scripts to players (per choice), and to do that i would have to set their character to another model with the scripts because for whatever reason i cannot affect the original scripts. However i am trying as hard as possible to add wipeouts only on reasonable cases (Example: killed by hazard). Is it possible? And if it is, how would you do that?

(Script attempt not provided because it is just a server script applying Destroy() to scripts. Awkwardly enough, it never yields when you try to destroy them, even when you use something like CharScript:WaitForChild():Destroy().)

1 answer

✓ Accepted answer

I don't have any good idea why you wouldn't be able to delete your script.

But okay, here goes.

--simple remove anims and sound on enter

game.Players.PlayerAdded:connect(function(plr)

repeat wait() until plr.Character
wait (0.1) --just to be safe

plr.Character.Animate:Destroy()
plr.Character.Sound:Destroy()
 
script.NewAnims:Clone().Parent=plr.Character
script.NewSounds:Clone().Parent=plr.Character

end)

plz accept and upvote 5 admin

EDIT: Added parenthases to the last bit

3 comments

0

Been tested and works in studio.

0

I was going to ask you about how to handle the health regen script, but WaitForChild ended up taking care nicely. Also, instead of waiting for character you can use the CharacterAdded event (so it would be plr.CharacterAdded:connect(char)). Here's an accept anyway because you tried.

0

My methods are old. I'm old. Thanks for the accept, though. :)

This discussion is preserved as it was. New answers, comments, and votes are closed.