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

How do I fix this?

Asked by 10 years ago

I made a tool (model) which is a ticket. And I made an NPC giver who gives the tool, but it only gives the gear tool and not the model. This is how I layed it out in Workspace:

> --Workspace
     > --Dialog
         > --Script
         > --DialogChoice
              > --DialogChoice

The script:

function clicked(player, dialogChoice)
print("Talked")
print(player)
print(dialogChoice)
if dialogChoice.Name == "Ticket" then
print("Player gives Ticket")
g = game:GetService("InsertService"):LoadAsset(213984396) --Model ID number
g.Parent = game.Workspace:FindFirstChild(player.Name) 
g:makeJoints() 
g:MoveTo(game.Workspace.FindFirstChild(player.Name).Head.Position)
else
print(dialogChoice)
end
end


script.Parent.DialogChoiceSelected:connect(clicked)


This is the Model of a Tool link: http://www.roblox.com/Ticket-item?id=213984396

Thank you :D

0
Are you sure the Model isn't loading at all? Try swapping lines 8 and 10 to see if that fixes it. adark 5487 — 10y

1 answer

Log in to vote
0
Answered by
yumtaste 476 Moderation Voter
10 years ago

The :MoveTo() function requires you to put Vector3.new(Vector3 position). You put the position, but not the "Vector3.new()" part. Here's a fix:

g:MoveTo(Vector3.new(game.Workspace.FindFirstChild(player.Name).Head.Position))
Ad

Answer this question