Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I fix this?

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

1 comment

0

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

1 answer

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))

This discussion is preserved as it was. New answers, comments, and votes are closed.