|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 21 May 2013 |
| Total Posts: 532 |
|
|
| 27 Oct 2017 06:23 PM |
just fire a remote event to the client
|
|
|
| Report Abuse |
|
|
|
| 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 |
|
|