Hello, I’m new to scripting and i wanna make my coin spin on the Y axis to make it a little more dynamic but when i use the orientation it says “Y cannot be assigned”
local debounceTime = 1
local canCollect = true
local function onTouched(hit)
if not canCollect then return end
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
local stats = player:FindFirstChild("leaderstats")
if stats then
local coins = stats:FindFirstChild("Coins")
if coins then
canCollect = false
coins.Value = coins.Value + 1
-- Optional: Add sound or particle effect here
coin.Transparency = 1
coin.CanCollide = false
wait(debounceTime) -- Time before coin respawns
coin.Transparency = 0
coin.CanCollide = true
canCollect = true
--- Changing the coins orientation ---
while true do
wait(0.1)
coin.Orientation.Y = coin.Orientation.Y + 0.3
end
end
end
end
end
coin.Touched:Connect(onTouched)
ERROR MSG BELOW
l
l
V