hey! ive been trying to get this silly little thing to work, and its probably so easy but i am simply not smart.
-- in localscript
local plat = game.ReplicatedStorage.platform
local uip = game:GetService("UserInputService")
local Players = game:GetService("Players")
local canspawn = true
local waiting = 0
uip.InputBegan:Connect(function(inputObject)
if inputObject.KeyCode == Enum.KeyCode.Q and canspawn == true then
local plr = Players.LocalPlayer
local hrp = plr.Character:WaitForChild("HumanoidRootPart")
local ncf = CFrame.new(hrp.Position) + Vector3.new(0, -2, 0)
print("ncf")
canspawn = false
local clone = plat:Clone()
clone.Parent = workspace
clone.CFrame = ncf
while true do
waiting = waiting +1
clone.CFrame = clone.CFrame * CFrame.fromEulerAnglesXYZ(0, 0.5, 0)
print("aaaaffefe")
wait()
if waiting == 147 then
waiting = 0
break
end
end
canspawn = true
wait(0.05)
clone:Destroy()
end
end)
ignoring the lack of coding skills, the main issue here it the while true loop, simply trying to make the part spin when its spawned. ive attempted to have the loop in a different script but theres the whole ordeal with cloning scripts from a localscript. ive also tried coroutines but i couldnt figure it out. It technically works but its very flimsy and i know there are ways several times better. ty!