D_devc
(D_devc)
July 31, 2021, 2:19am
1
What do you want to achieve?
Make so when the player touches a part he gets sick
What is the issue?
GUI doesn’t tween, but it plays the sound and prints.
What solutions have you tried so far?
I tried everything even changing to a server sided script.
local gui = game.StarterGui:WaitForChild("A")
local frame = gui:WaitForChild("anxiety")
script.Parent.Touched:Connect(function(addAnxiety)
print('nothing')
frame:TweenSize(UDim2.new(0, 448,0, 56),Enum.EasingDirection.In,Enum.EasingStyle.Back,2)
workspace.cough:Play()
workspace.cough.Looped = true
end)
1 Like
D_devc
(D_devc)
July 31, 2021, 2:22am
3
Yep I am using server script now.
I already tried and nothing
Is there any way to fix this?
Can I see the script that used PlayerGui?
D_devc
(D_devc)
July 31, 2021, 2:31am
5
local player = game:GetService("Players").LocalPlayer
local gui = script:WaitForChild("A"):Clone()
local frame = gui:WaitForChild("anxiety")
script.Parent.Touched:Connect(function(addAnxiety)
gui.Parent = player.PlayerGui
print('nothing')
frame:TweenSize(UDim2.new(0, 448,0, 56),Enum.EasingDirection.In,Enum.EasingStyle.Back,2)
wait(2)
workspace.cough:Play()
workspace.cough.Looped = true
end)
maybe it’s wrong, im starting to script
Local scripts don’t work in the workspace.
You can’t use LocalPlayer
in a server script.
1 Like
D_devc
(D_devc)
July 31, 2021, 2:37am
9
Then how I would put it on PlayerGui?
You cannot use Players | Roblox Creator Documentation in a server script. But you can use Players | Roblox Creator Documentation
local gui = script:WaitForChild("A"):Clone()
local frame = gui:WaitForChild("anxiety")
script.Parent.Touched:Connect(function(addAnxiety)
if addAnxiety.Parent:FindFirstChild("Humanoid") then
local player = game:GetService("Players"):GetPlayerFromCharacter(addAnxiety.Parent)
gui.Parent = player.PlayerGui
print('nothing')
frame:TweenSize(UDim2.new(0, 448,0, 56),Enum.EasingDirection.In,Enum.EasingStyle.Back,2)
wait(2)
workspace.cough:Play()
workspace.cough.Looped = true
end
end)
2 Likes
D_devc
(D_devc)
July 31, 2021, 2:41am
11
Is there a way to I make the gui always appears?
Hello, what do you mean by that?
D_devc
(D_devc)
July 31, 2021, 2:47am
13
I want it to when you spawn on the game you have this GUI here
but instead it just appears when i touch the part.
Then you can put it in StarterGui and when the player joins the game, it will be copied to the player’s PlayerGui.
2 Likes