generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: FE Morph GUI

Previous Thread :: Next Thread 
PresidentBoston is not online. PresidentBoston
Joined: 25 Mar 2010
Total Posts: 4429
27 Oct 2017 04:55 PM
Hello

I have a morph GUI in experimental with multiple buttons, and a script like this

local Button = script.Parent
local Assets = script.Parent.Parent.Parent.Assets
local plr = script.Parent.Parent.Parent.Parent.Parent.Character
local Head = plr.Head
local Teleporter = game.Workspace.Teleporter
local Player = script.Parent.Parent.Parent.Parent.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")

if Player:GetRankInGroup(3057001) >= 1 and Player:IsInGroup(3057001) then
Button.Visible = true
end




function MouseEnter()
Button.Parent.Parent.PictureFrame.Trooper.Visible = true
end

function MouseLeave()
Button.Parent.Parent.PictureFrame.Trooper.Visible = false
end

function GiveUniform()
local h = Assets.Standard.Trooper.Helmet:clone()
for i,v in pairs(h:children()) do
local W = Instance.new("Weld")
W.####### #.######## # W.####### v
local CJ = CFrame.new(h.Middle.Position)
local C0 = h.Middle.CFrame:inverse()*CJ
local C1 = v.CFrame:inverse()*CJ
W.#### #0## # W.#### #1## W.Parent = h.Middle
end
local bweld = Instance.new("Weld")
bweld.Part0= Head
bweld.Part1=h.Middle
h.Middle.Anchored=false
h.Middle.Transparency = 0
bw########################## bweld.Parent=h.Middle
h.Middle.CFrame=Head.CFrame*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
for i,v in pairs(h:children()) do
v.Anchored=false
end
h.Parent=plr
for i,v in pairs(h:children()) do
v.CanCollide=false
end
Head.Transparency = 1
plr.Head.face:remove()

local d = plr:GetChildren()
for i=1, #d do
if (d###############= "Accessory") then
d[i]:remove()
end
end

local sh = Assets.Standard.Trooper.Shirt:clone()
plr.Shirt:remove()
sh.Parent = plr

local pan = Assets.Standard.Trooper.Pants:clone()
plr.Pants:remove()
pan.Parent = plr

plr:MoveTo(Teleporter.Position)

script.Parent.Parent.Parent:remove()


end


Button.MouseButton1Down:connect(GiveUniform)
Button.MouseEnter:connect(MouseEnter)
Button.MouseLeave:connect(MouseLeave)


I want to know what the most effective way to make the buttons appear now in Filtering Enabled since they are not currently compatible is.

thanks
Report Abuse
UpbeatBamalot is not online. UpbeatBamalot
Joined: 30 Aug 2016
Total Posts: 30
27 Oct 2017 05:03 PM
To be able to move your project to filtering enabled, you need to know a bit about Client-Server communication. A client cannot edit the server (Well, it can, but the change will actually only effect the current player, not the server, thus other players will not be effected). So you need to research remote functions, and remote events to communicate between Server and Client. So instead of directly changing values in a function, maybe make a remote function do all that code on the server. Hope that helps. Feel free to ask questions.
Report Abuse
UpbeatBamalot is not online. UpbeatBamalot
Joined: 30 Aug 2016
Total Posts: 30
27 Oct 2017 05:05 PM
All changes to guis only effect the current player anyways, so no need for remote functions there. Just the GiveUniform function, and some code after it that edits values that are not the players.
Report Abuse
PresidentBoston is not online. PresidentBoston
Joined: 25 Mar 2010
Total Posts: 4429
27 Oct 2017 05:11 PM
I assume these lines are the ones you're referring to?

local sh = Assets.Standard.Trooper.Shirt:clone()
plr.Shirt:remove()
sh.Parent = plr

local pan = Assets.Standard.Trooper.Pants:clone()
plr.Pants:remove()
pan.Parent = plr

plr:MoveTo(Teleporter.Position)

Report Abuse
v_ery is not online. v_ery
Joined: 21 May 2013
Total Posts: 532
27 Oct 2017 06:23 PM
just fire a remote event to the client


Report Abuse
UpbeatBamalot is not online. UpbeatBamalot
Joined: 30 Aug 2016
Total Posts: 30
28 Oct 2017 07:02 PM
Yeah, pretty much any change of a value not inside the player is a big No-No. Just put all that code in a remote function (Not an event) so the function will return when completed. Events wont wait until it i completed to return.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image