#Why isnt that working ( rotating the cube )
37 messages · Page 1 of 1 (latest)
local RunService = game:GetService("RunService")
local cube = script.Parent
local degreesPerSecond = 30
local radiansPerSecond = math.rad(degreesPerSecond)
local function onRenderStep(deltaTime)
local deltaRotation = deltaTime * radiansPerSecond
local currentCFrame = cube.CFrame
local rotationCFrame = CFrame.Angles(0, deltaRotation, 0)
cube.CFrame = currentCFrame * rotationCFrame
end
RunService.RenderStepped:Connect(onRenderStep)
@void zinc
i forgot to put task.wait mb
but its using renderstep so it probably shouldn't crash
local RunService = game:GetService("RunService")
local cube = script.Parent
local degreesPerSecond = 30
local radiansPerSecond = math.rad(degreesPerSecond)
local function onRenderStep(deltaTime)
local deltaRotation = deltaTime * radiansPerSecond
local currentCFrame = cube.CFrame
local rotationCFrame = CFrame.Angles(0, deltaRotation, 0)
cube.CFrame = currentCFrame * rotationCFrame
task.wait()
end
RunService.RenderStepped:Connect(onRenderStep)
if it keeps crashing just increase the wait time
@void zinc this could never lag your game. it's basically no computing power
add this script to a part and change it's run context to client. it should work without any issues
bruh gtx 1650, intel 10300H, 16GB ram
ohh let me try
even if you were on a low end pc it can't lag
lag
I changed from script to localscript still the same lag
oh the lag is like for 15 seconds but its not spinning
I can add you to my project or something
anchor a part and parent the script to the part
** You are now Level 9! **
to show u
it is
oh I found what was making the lag
but still not spinning
local main = script.Parent.main
local powloka = script.Parent.powloka
local pociete = script.Parent.pociete
local ts = game:GetService("TweenService")
local ti = TweenInfo.new(3, Enum.EasingStyle.Sine)
local list = {main, powloka, pociete}
local size = {7, 8, 9}
local active = false
function activate()
for number, object in pairs(list) do
local big = ts:Create(object, ti, {
Size = Vector3.new(size[number], size[number], size[number])
})
big:Play()
end
active = true
while active == true do
end
end
wait(5)
activate()``` That was making the lag
bruh now I see the infinite loop
that script is working. anchor a part and parent a script to it and set it's run context to client
let me record you this
what do you mean change context to client?
I'm using roblox studio for 3 years but when I joined today that discord I see im dumb