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

How to affect player character scripts?

Asked by
Marios2 360 Moderation Voter
9 years ago

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

Log in to vote
0
Answered by 9 years ago

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

0
Been tested and works in studio. ChemicalHex 979 — 9y
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. Marios2 360 — 9y
0
My methods are old. I'm old. Thanks for the accept, though. :) ChemicalHex 979 — 9y
Ad

Answer this question