Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Gui transparency tween not working well?

Asked by 3 years ago

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

Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
3 years ago

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.

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 DraconianSG 58 — 3y
0
Can you show me your script? Xapelize 2658 — 3y
0
Its fine i got it figured out, i wrote the locals wrong DraconianSG 58 — 3y
0
Alright Xapelize 2658 — 3y
Ad

Answer this question