Hi I dont know how to script in roblox studio but I wanna make a game where you float and then after 30 seconds you die if you dont reach the end. Do you know any way to do this? If you can ill sub and reccomend u to loads of ppl :)
You can change the speed by multiplying the tick() with a number, and you can change the height by multiplying the math.sin(tick()) by a number. An example of this could be: math.sin(tick() * 2) * 3 This would make it go two times faster and three times higher
the script for levitation for the other people and for me just copy and paste it in your roblox script (levitation script) local part = script.Parent local startPos = part.Position while true do wait() part.Position = startPos + Vector3.new(0,math.sin(tick()),0) end
correct version: local part = script.Parent local startPos = part.Position while true do wait() part.Position = startPos + Vector3.new(0,math.sin(tick()),0) end
script it might not work bc i might of did something wrong Rotations script local TweenSeverice = game:GetService ("TweenService") local part = script.Parent local goal = {} goal.Orientation = Vector.new(0,360,0 local tweeninfo = TweenInfo.new(3, Enum.EasingStyle.Linear, Enum.EasingDirection.in, 2, flase 0) local tween = Tween Service:Create(part, TweenInfo, goal) while true do Tween:Play() tween.Completed;Wait() end YPos script local part = script.Parent local startPos = part.Position while true do wait() part.Position = startPos + Vector3.new(0,match.sin(tick()),0) end
Rotation Script: Line 5 (goal.Orientation) - need a ) at the end Line 7 (local tweeninfo =) - you spelled "false" wrong and need a comma after false as well. "In" should be capitalized as well. Line 9 (local tween =) - No space between "Tween" and "Service" Line 12 (Tween:Play()) - "Tween" should not be capitalized. Line 13 (tween.Completed) - you have a semicolon ( ; ) instead of a colon ( : ) YPos Script Seems fine.
Updated version of the rotation script: local TweenService = game:GetService ("TweenService") local part = script.Parent local goal = {} goal.Orientation = Vector3.new(0,360,0) local tweeninfo = TweenInfo.new(3, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 2, false, 0) local tween = TweenService:Create(part, TweenInfo, goal) while true do tween:Play() tween.Completed:Wait()
i dont mean to be mean but you dont have to do all of that to make a part spin i mean look at this easy script i made local --your part name here-- = script.Parent while true do --your local variable here--.Orientation = --your local variable here--.Orientation + Vector3.new(0, 1, 0) wait(0.01) end this is why sometimes i feel like people only make their scripts complicated to make their videos longer
Let me know if you have an idea what i should make a video on next!
This really helped with my game! I would definitely recommend this to people trying
to make a levitating object.
Thank you so much! Now I can make the floating effect for my Golden Orb! :)
You deserve a like and a sub!
seriously dude... you're a lifesaver 👍
seriously man.. YOU SAVED MY LIFE!i was searching in yt how to make a floating part and it only apear only the floating part! tysm for existing!
thank you!! It made my game cooler
Thank you so much!!
Good tutorial
Thank you so much!
W!
Thanks this helped a lot I am making a game based off the movie nope
thank you!
does this work on a rig character?
im tryna make my character float
whats the point of putting tick in the "YPos" script?
This video was great, but i think the script can use runservice stepped funtion instead of using while true do
How do you make the floating part not go up and down so much?
Ik this was 2 years ago but i got a question. How do you make it float up and down but without the spinning?
You just gotta remove the "Rotation" script
Hi I dont know how to script in roblox studio but I wanna make a game where you float and then after 30 seconds you die if you dont reach the end. Do you know any way to do this? If you can ill sub and reccomend u to loads of ppl :)
does this work with models?
How can I change the distance and speed of the floating? I would like it to float faster and higher.
You can change the speed by multiplying the tick() with a number, and you can change the height by multiplying the math.sin(tick()) by a number.
An example of this could be:
math.sin(tick() * 2) * 3
This would make it go two times faster and three times higher
@@xSweDev Thank you!
@@xSweDev you forgot the ) at the end :D
how can you do this on r6?
How can i do with model and it have parts i want to levitate whole model
in each part of the model put the same script on each part of the model
just weld everything together
the script for levitation for the other people and for me just copy and paste it in your roblox script (levitation script)
local part = script.Parent
local startPos = part.Position
while true do
wait()
part.Position = startPos + Vector3.new(0,math.sin(tick()),0)
end
correct version:
local part = script.Parent
local startPos = part.Position
while true do
wait()
part.Position = startPos + Vector3.new(0,math.sin(tick()),0)
end
where is the difference@@garfield2317
theres no difference@@garfield2317
script it might not work bc i might of did something wrong
Rotations script
local TweenSeverice = game:GetService ("TweenService")
local part = script.Parent
local goal = {}
goal.Orientation = Vector.new(0,360,0
local tweeninfo = TweenInfo.new(3, Enum.EasingStyle.Linear, Enum.EasingDirection.in, 2, flase 0)
local tween = Tween Service:Create(part, TweenInfo, goal)
while true do
Tween:Play()
tween.Completed;Wait()
end
YPos script
local part = script.Parent
local startPos = part.Position
while true do
wait()
part.Position = startPos + Vector3.new(0,match.sin(tick()),0)
end
Rotation Script:
Line 5 (goal.Orientation) - need a ) at the end
Line 7 (local tweeninfo =) - you spelled "false" wrong and need a comma after false as well. "In" should be capitalized as well.
Line 9 (local tween =) - No space between "Tween" and "Service"
Line 12 (Tween:Play()) - "Tween" should not be capitalized.
Line 13 (tween.Completed) - you have a semicolon ( ; ) instead of a colon ( : )
YPos Script
Seems fine.
Updated version of the rotation script:
local TweenService = game:GetService ("TweenService")
local part = script.Parent
local goal = {}
goal.Orientation = Vector3.new(0,360,0)
local tweeninfo = TweenInfo.new(3, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 2, false, 0)
local tween = TweenService:Create(part, TweenInfo, goal)
while true do
tween:Play()
tween.Completed:Wait()
end
@@thunderwolf9570 the y pos script overall is fine but instead of saying match is says math on the 6th line
ypos one instead of math you wrote match
Works great but I can't get a group to move even tho all the parts a welded together
use weld constraints
i dont mean to be mean but you dont have to do all of that to make a part spin i mean look at this easy script i made
local --your part name here-- = script.Parent
while true do
--your local variable here--.Orientation = --your local variable here--.Orientation + Vector3.new(0, 1, 0)
wait(0.01)
end
this is why sometimes i feel like people only make their scripts complicated to make their videos longer
I was farily new to scripting when uploading this video. I could easily improve this, but theres no point.
oh my bad sorry
doesnt work
not work ❤️🩹