The tweening part of this script works perfectly in studio and studio server test but not in the actual game. Everything else works perfectly except the tweening. All i need help with is making the tween work in servers.
local NPC = script.Parent.UpperTorso
while true do
local ply = game.Players:GetChildren()
for i = 1, #ply do
local char = game.Workspace:findFirstChild(ply[i].Name)
if char ~= nil then
if (NPC.Position - char.UpperTorso.Position).magnitude <= 8 then
if ply[i]:findFirstChild("TalkingToNPC") then
else
if ply[i].Gamestuff.Characters.Folder.Class.Value == "None" then
local thing = Instance.new("StringValue",ply[i])
thing.Name = "TalkingToNPC"
local ChatClone = script.ChatGui:Clone()
ChatClone.Name = "ChatClone"
ChatClone.Parent = ply[i].PlayerGui
ChatClone.Press:TweenPosition(UDim2.new(0.5, -150, 1, -200), "Out", "Back", 0.7, false)
ChatClone.KeyPress.Disabled = false
elseif ply[i].Gamestuff.Characters.Folder.Class.Value ~= "None" then
local thing = Instance.new("StringValue",ply[i])
thing.Name = "TalkingToNPC"
local ChatClone = script.ChatGui2:Clone()
ChatClone.Name = "ChatClone"
ChatClone.Parent = ply[i].PlayerGui
ChatClone.Press:TweenPosition(UDim2.new(0.5, -150, 1, -200), "Out", "Back", 0.7, false)
ChatClone.KeyPress.Disabled = false
end
end
elseif (NPC.Position - char.UpperTorso.Position).magnitude > 8 then
if ply[i].PlayerGui:findFirstChild("ChatGui") or ply[i].PlayerGui:findFirstChild("ChatGui2") or ply[i].PlayerGui:findFirstChild("ChatClone") then --:findFirstChild("TalkingToNPC")
ply[i]:findFirstChild("TalkingToNPC"):destroy()
ply[i].PlayerGui.ChatClone.Press:TweenPosition(UDim2.new(0.5, -150, 1.5, -200), "In", "Back", 0.7, true)
wait(0.8)
ply[i].PlayerGui.ChatClone:destroy()
end
wait()
end
end
end
wait(0.1)
end

2 comments
O hey it works
YAY! @wallopinweb