01 | local Cooldown = 10 |
02 | local db = false |
03 | local plr = game.Players.LocalPlayer |
04 | script.Parent.MouseButton 1 Click:Connect( function () |
05 | if db = = false then |
06 | db = true |
07 | game.Lighting.La:Clone().Parent = workspace |
08 | wait() |
09 | workspace.La.Position = plr.Character.Humanoid.Parent.Head |
10 | for i = Cooldown, 0 , - 1 do |
11 | wait( 1 ) |
12 | script.Parent.Text = "Cooldown: " ..i |
13 | end |
14 | script.Parent.Text = "Spawn" |
15 | db = false |
16 | end |
17 | end ) |
Error: Position is not a valid member of Model
Any ideas?
Roblox has a function for moving models, just as long as they have a primary part, which can be set in the properties of the model.
To move a model, just use SetPrimaryPartCFrame()
Example:
1 | local head = plr.Character.Humanoid.Parent.Head |
2 | workspace.La:SetPrimaryPartCFrame(CFrame.new(Vector 3. new(head.Position.X, head.Position.Y, head.Position.Z)) |
You need to use the method SetPrimaryPartCFrame to move models. For example:
1 | workspace.La:SetPrimaryPartCFrame(plr.Character.Head.CFrame) |
2 | -- you need to set the primary part of the model first. |