Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

how would you make a model spin locally?

Asked by
quinzt 201 Moderation Voter
4 years ago

I have a fan that spins to add extra effect to the map, and in hopes to reduce lag (my game has over 1200 client memory usage) i want to make it a local script. its a standard spin script

local fan = script.Parent.Parent
while true do
    fan.PrimaryPart = fan.center
fan:SetPrimaryPartCFrame(fan.center.CFrame * CFrame.fromEulerAnglesXYZ(0,0.1,0))
wait()
end

but i want to make it local. i tried to put it in a local script but that didnt work.. now that im writing this it may be impossible idk help would be appreciated

0
i just realized that i should move the primary part definition outside of the loop lol quinzt 201 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
local fan = script.Parent.Parent

local function partRotation(part)
while true do
        fan.PrimaryPart = fan.center
    fan:SetPrimaryPartCFrame(fan.center.CFrame * CFrame.fromEulerAnglesXYZ(0,0.1,0))
    wait()
    end
end

partRotation()

put this in a local script also

edit: forgot to call function

0
doesnt work- when i test the fan doesnt spin quinzt 201 — 4y
0
:( ScriptsALot 91 — 4y
Ad

Answer this question