Greetings, quite new to these forums, so don't bite too hard.
I've been writing a script that applies a morph (like in some 3D Role-playing games), and it's worked-- for the most part. What's been bothering me for the last few hours is that it's displaying an odd behavior, especially in my tests with a local server/published game.
The script worked fine for say Player1 and Player2, however I could only see my own morph and not the other players morph. It was as if it was applying the morph locally to what the player sees instead of being server-wide. So to try to figure out what I'm doing wrong, I wrote a small example script
Player = game.Players.LocalPlayer repeat wait() until Player.Character Character = Player.Character Character:WaitForChild("Humanoid") Button = script.Parent ------------------------------------------------------------------------------------- function test() local h = game.Workspace[Player.Name].Humanoid h.Parent.Torso.Transparency = 1 end ------------------------------------------------------------------------------------- Button.MouseButton1Down:connect(test)
This is in the form of a local script that when you click the button, it should make your torso transparent.. I've tried a few things to see if I could get it to work properly, but to no avail. It works only to Player1's perspective, but not Player2's.
I've been stumped on this and I feel it's something really stupid. Any help will be appreciated!
Hi, iWolfODonnell!
I found an error! If your character is R15 torso does not exist, it is UpperTorso or LowerTorso. here is the fix: This is a localscript
Player = game.Players.LocalPlayer repeat wait() until Player.Character Character = Player.Character Character:WaitForChild("Humanoid") Button = script.Parent ------------------------------------------------------------------------------------- function test() local h = Character.Humanoid if not h.Parent:FindFirstChild('UpperTorso') then h.Parent.Torso.Transparency = 1 else h.Parent.UpperTorso.Transparency = 1 end end ------------------------------------------------------------------------------------- Button.MouseButton1Down:connect(test)
@EDIT > There was an error on the script!