I just need a GUI that removes a hat from a morph!

Technically, what I want is something like putting a mask on + the mask back off, similar to how you remove masks and put them, here is an example of what I want to achieve.

Before pressing the GUI:
Screen Shot 2022-12-13 at 8.19.49 PM
After pressing the GUI:
Screen Shot 2022-12-13 at 8.20.12 PM

That might be enough info I can give, I’m not really a scripter knowing that I’m bad at coding, lol.

1 Like

Other info: And plus the GUI would only appear when the morph is on.

do you already have a morph system in place?

1 Like

It honestly seems like you are just asking the dev forum to make a script for you.

  1. We cannot do that without knowing the morph structure on the character.
  2. We can give pointers, but this should be your learning experience, not you getting someone to make you a script.
2 Likes

yep, it’s clicking it’s torso to morph into that specific character.

  1. I did mention I wasn’t really a great scripter really…
  2. let’s just say I’m not used to advanced learning about coding.
  3. the morph is just a click to morph thing.
  4. It’s scripting support, meaning I can’t write the script when I do not know how to…

is the helmet inside of the players character model or like a screenshot of how the hierarchy looks when its equipped, if so it wont be too hard

generally going through pseudo code, aka voicing out your code in steps is easier to format for yourself to figure out what u need to do and to use, but ill help where i can

1 Like

You could put a local script in the hat of the morph, and when the morph is worn, it should pop up a gui, when the gui is clicked the hat can transform between Transparency = 1 and Transparency = 0 (or default for that hat)

problem is that’s all local, if he’s gonna apply in a game with other players that won’t work too good but if it’s for yourself it would although the transparency idea is correct

The gui fire’s an event to the server, and the server sets the transparency for the player.

gotcha then yes i agree, same idea here my bad

My simple last resort here is to make the hat transparent and visible again when clicked, I already have a code but I assume that it doesn’t work for hats.

Code:

local Handle = script.Parent
local CD = script.Parent.ClickDetector

function on ()
	isOn = true
	Handle.Transparency = 0
end

function off()
	isOn = false
	Handle.Transparency = 1
end

function onClicked()
	if isOn == true then off() else on() end
end

CD.MouseClick:Connect(onClicked)
on()

Explain with a script or something? (sorry, like what I said I’m not really a god at coding…)

well honestly, not a bad attempt! you’re close! we can use these on and off functions for the server script, the click detector we dont need. ultimately there should be a screengui in startergui with a frame and a button, with a localscript inside detecting whether the helmet is inside the players character model, then if the player clicks the button, send a remote event to the server script, we can put this is serverscriptservice, we can listen for the remote in the server and have it turn on or off based on a if statement similar to your OnClicked function!

for example:

LocalScript:

local button = script.Parent
local plr = game.Players.LocalPlayer
local character = plr.Character
local gui = button.Parent.Parent
local Remote = game.ReplicatedStorage.RemoteEvent

function Check()
  if character.Handle then 
    gui.Enabled = true
       return true
  else
     gui.Enabled = false
       return false
  end
end


function Send()
   if Check() == true
     Remote:FireServer(plr, Character.Handle)
       print("sent")
   else
    return print("nil")
  end
end


button.Activated:Connect(Send)

try the server script on your own! here’s a little starting tip in your server script! if you need help u can definitely ask of course

Server script tip:

local Remote = game.ReplicatedStorage.RemoteEvent

--previous functions that u had could work here

Remote.OnServerEvent:Connect(function(plr)

--previous functions that u had could work here

end
1 Like
script.Parent.MouseButton1Click:Connect(function()
	workspace.VaderMorph["Your hat that you want to remove"]:Destroy
	script.Enabled = false
	script.Parent.Parent.Enabled = false
end)

Well I do have 1 question, where am I exactly supposed to put both scripts?

ultimately you’d need to make a ScreenGUI with a frame inside if that, and then a button inside of the frame, thats where the localscript goes, inside the button.

the server script goes in the helmet actually sorry*
and a remoteevent in the replicatedstorage

Screen Shot 2022-12-15 at 2.12.28 PM
somehow this is happening but alr, doing all the steps.

I’ve also gotten this somehow
Screen Shot 2022-12-15 at 2.21.08 PM

i edited it, it should be better

I think you meant modulescript or smth…