Hey, working on a small survivor v killer game to learn scripting and need to write a script to morph a single selected player (whose username stored in an ObjectValue called chosen) into a different rig I've created. I've already written the code to select a player, but I can't figure out how to actually morph the player into the rig/model. (Which is just a modified but largely default R15 model) I've tried multiple tutorials on how to make physical and GUI-based morphs, but I can't figure out how to get it to work for my use-case. Does anyone have any suggestions?
#Trouble Morphing a Specific Player
1 messages · Page 1 of 1 (latest)
I've been using this script
you do need a remoteevent named CharacterEvent in ReplicatedStorage though
you just fire this in your gui replace character name with your character and put this into a button click script
pong
i'll give this a shot rq, thanks chat
put in servicescriptservice btw
this script is supposed to be parented under the CharacterEvent remoteevent right?
or am i stupid
i might be stupid
no
oh mb
in serverscriptservice
yeah in hindsight i probably should have figured that out lmao
does the script have to be named anything specific so that the CharacterEvent can identify it?
** You are now Level 1! **
sorry for all the questions, new to Lua and still don't fully know what i'm doing
no
the script has to identify CharacterEvent not the otherway around
ah, i see
mb mb
the enabled script is the one that i put this into
this is the gui script, just a simple text button
ignore my messy organization, still working some things out
it needs to be a local script
ah
yeah that
that makes sense in hindsight
mb
i'll change it and test, brb
still not working
wait
did you mean this needs to be a localscript?
because if so i am extraordinarily stupid
made this a localscript and the main code a regular script, still non-functional
@kind drift u there? sorry to pester
huh
well, i first tried making the main script a localscript, which didnt work
** You are now Level 2! **
then realized you probably meant the gui script had to be local, so i swapped the main script back to standard and the gui script to local
which also didnt work
so there has to be something i'm doing wrong, i just cant figure out what
should they both be localscripts?
wait are there any scripts that need to be copied from 1 character to another
what do you mean?
i mean
i mean, not what i know of, it's only changing the players avatar, nothing else
i'll check but i believe so
wait
i made the rig by just spawning an r15 model and scaling different sections, so
why is is it waiting for screen gui
i'll be honest, i'm still pretty new to Lua and forgot how to program a click button GUI
i looked up a tutorial on how to make one
the morph is supposed to be triggered when a timer reaches zero, but i figured id throw together a simple gui just to make sure the code actually worked in a vacuum first
remove the waitforchild (screengui) part
k
and the colon
that should work
the textbutton thing shouldn't be needed as it just legnthens the script as it's used only one time
just do script.Parent
i say near because i had custom walk/run animations for the entity that didnt carry over in the morph
but that's fine, i can fix that later
thanks again! :D
hold on
** You are now Level 3! **
oh?
is the animations in startercharacterscripts
in starterplayer?
because if so, no
it's in the animate localscript for the entity
oh hold on
delete this part of the main script
it removes the scripts inside the entity to replace with the startercharacter ones
from newChar.Name = player.Name to the second End?
ahhhh makes sense
no
right below it
for _ to end
so including the
for . v in pairs(game.starter...
line?
no
k
nevermind i got confused
** You are now Level 3! **
yes
k
gotcha
sorry if my screenshot was confusing
yes
np
hey so @kind drift
sorry to keep pestering you but
is there a way of activating the event with another script?
yes this one
gotcha, will test it rq
yeah, it didnt work
the rest of the script it was in worked, but the morph didnt occur
i can send the script it's in if need-be?
@kind drift
** You are now Level 4! **
sure
line 15* is the trigger
all the script does is pick a random player as the killer, displaying it on their screen with a Gui and giving them a sword
the sword was just to make sure the script worked, wont be final
ah
yeah with that, the script does save the players username in an ObjectValue in ReplicatedStorage on line 9
could i use that somehow?
afk
idk maybe try that
player and then the character
i'll give it a shot
you mean something like this?
yes
what is it
** You are now Level 4! **
could something like this work?
cause chosen is just the players username
so could this call on the specific player? maybe?
maybe that will work
afraid not :/
ah
so instead of copying the localscripts code isntead we copy the main script
ima do some edits
replace the fire server thing with this
the one that was previously used in the gui?
yes and is now in the script your using
this
should replace this, right?
no
k, the gui script it is
wanted to check in case this was unclear
i meant this
thx, testing now
LETS GO
IT WORKS HELL YEAH
dude i genuinely cannot help you enough for this
i'm still learning too
i literally started learning like 2-3 days ago you are 100% more qualified than me here
i didn't know how to change a persons character not using a localscript and using a serverscript instead until now