For those who are complaining that I'm making too much posts today
I’m trying to make a proper game as a solo dev.
Hey everyone! So I’m making a game which includes tweening but nothing shows up in output. Here’s the hierarchy:
(In the file name I misspelled)
The local script inside the screen gui:
local secondCount
game.ReplicatedStorage.TweenDetails.OnServerEvent:Connect(function()
local player = game.Players.LocalPlayer
script.Parent.Parent = game.StarterGui
game.ReplicatedStorage.TweeningEvent:FireClient(player)
end)
and the script inside the starter gui:
local tweenService = game:GetService("TweenService")
game.ReplicatedStorage.TweeningEvent.OnClientEvent:Connect(function()
local frame = script.Parent.ScreenGui:WaitForChild("Frame")
if frame then
local table = {}
table.Position = UDim2{0.5, 0.5}
local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, true, 0)
local tween = tweenService:Create(frame, tweenInfo, table)
tween:Play()
end
end)
Thanks for the help!
(Please tell me if anything is outdated, I got this from the API)
Why are you using WaitForChild then after checking if it exists. WaitForChild yields until the thing you are looking for is found!
Also why is there a gui inside of ServerStorage, not only do scripts not run in ServerStorage but only the server can see what is inside of ServerStorage.
??? I do not understand this. I set the parent of the gui to starter gui in the 1st code I put above.
Wait it doesn’t run in server storage? So I should put it in replicated storage?
If you actually don’t want the code to run yet then ServerStorage is fine, but the player cannot access ServerStorage.
And you never parented any gui to StarterGui with code because:
local secondCount
game.ReplicatedStorage.TweenDetails.OnServerEvent:Connect(function()
local player = game.Players.LocalPlayer
script.Parent.Parent = game.StarterGui --This actually tries to parent the DataModel to startergui.
game.ReplicatedStorage.TweeningEvent:FireClient(player)
end)
I am really unsure what you mean because there is a lack of details in the post but.
Localscripts will only run if it is a descendant of one of the player script containers:
Everyone in the server, after they complete an obstacle course. Here’s the game file (I’m doing the important parts first before the course) Speedrunners (ALPHA).rbxl (33.6 KB)
That place file works without making any changes, and the cooldown isn’t meant to be on the client but i was in a bit of a rush. That should always be on the server. Touch can fire loads of times for one part, hence i added some form of cooldown.
Oh no after turning the easing style to quint it’s giving me an error I fixed earlier. When trying to teleport from the lobby, it says I’m not a player object, even after debugging
The dev forum isn’t really a place for people to write code for you, i only did because it helped me explain. And even more so i mentioned
(Please do not use the code in here as it is, it is not meant for production but more the less acts as a showcase)
You aren’t meant to USE the code in the place file in an actual project, it contains explanations in the form of comments and shows how you can use tweenservice and more, it isn’t production ready.
(Also the reason lots of things are missing is because lots of those things weren’t necessary to have)
I changed the easing style to quint in the hopes of it working.
All changing the easing style will do is change how the animation looks, or as it’s names, how it eases into the properties you gave it.
I unfortunately have to leave because i have things i need to do, but remember that Localscripts will only run if they are descendants of player containers, which means StarterGui, StarterScripts, a players character or StarterPack