Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Gui transparency tween not working well?

Ok so im trying to make a item wheel type thing so that when they player presses V they tween in individually. And i have a few problems, mainly the V keycode not losing the Wheel afterwards, setting the Modal to true doesnt work and finally no matter how short i set the Waits to it still takes a semi large amount of time, im not sure if there is a way to fix that last one but it would be nice if there was

local UI = script.Parent
local one = script.Parent.Wep1
local two = script.Parent.Wep2
local three = script.Parent.Wep3
local four = script.Parent.Wep4

local TweenService = game:GetService("TweenService")
local time = 0.1

local In1 = TweenService:Create(one, TweenInfo.new(time), {ImageTransparency = 1})
local In2 = TweenService:Create(two, TweenInfo.new(time), {ImageTransparency = 1})
local In3 = TweenService:Create(three, TweenInfo.new(time), {ImageTransparency = 1})
local In4 = TweenService:Create(four, TweenInfo.new(time), {ImageTransparency = 1})
local Out1 = TweenService:Create(one, TweenInfo.new(time), {ImageTransparency = 0.5})
local Out2 = TweenService:Create(two, TweenInfo.new(time), {ImageTransparency = 0.5})
local Out3 = TweenService:Create(three, TweenInfo.new(time), {ImageTransparency = 0.5})
local Out4 = TweenService:Create(four, TweenInfo.new(time), {ImageTransparency = 0.5})

local open = false

local UserInputService = game:GetService("UserInputService")

UserInputService.InputBegan:Connect(function(keyCode)
	if keyCode.keyCode == Enum.KeyCode.V then
		if open then
			In1:Play()
			In2:Play()
			In3:Play()
			In4:Play()
			one.Modal = true
			two.Modal = true
			three.Modal = true
			four.Modal = true
		else
			Out1:Play()
			Out2:Play()
			Out3:Play()
			Out4:Play()
		end
	end
end)

1 answer

Only the server sees StarterGui, what clients (player) sees is the PlayerGui.

Put the LocalScript on StarterGui.

This is an example:

-- LocalScript

game.Players.LocalPlayer:WaitForChild("PlayerGui").ScreenGui.Frame.BackgroundTransparency = 0

This will make the frame's background transparency to 0, but what server sees is still the default (the frame on StarterGui).

I hope this helps, if you have any questions, comment below!

Also, simply replace the script.Parent in your script's line 1 to 5 to game.Players.LocalPlayer:WaitForChild("PlayerGui").ScreenGui. Relocate the ScreenGui to the "weps" in PlayerGui.

Another note: PlayerGui clones StarterGui's children inside. Meaning changing the StarterGui properties will also affect PlayerGui when player joined.

4 comments

0

Ok i've made a few changes to my original script based on what you said and ive added one of my own things which was a "Frame.Enabled = true" i changed the local ui to a local frame. but whenever i press the button it doesn't want to enable the frame

0

Can you show me your script?

0

Its fine i got it figured out, i wrote the locals wrong

0

Alright

This discussion is preserved as it was. New answers, comments, and votes are closed.