On click with left Mouse Button
- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
On click with left Mouse Button
hi again guys..
Is there a function that allows you to Click on a object and then Play a sound.. I have the onPickUp done but that's different..
EG: Player left clicks on a altar and it plays a sound..
I hope it can be done I have a great idea for this if it works..
Thank You again..
Is there a function that allows you to Click on a object and then Play a sound.. I have the onPickUp done but that's different..
EG: Player left clicks on a altar and it plays a sound..
I hope it can be done I have a great idea for this if it works..
Thank You again..
Re: On click with left Mouse Button
you could have an invisible object there, use onPickUpItem
Finished Dungeons - complete mods to play
- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: On click with left Mouse Button
Hi Komag..
That sound like a good idea, I like it. but would the party actually pick the Invisible Item Up??
That sound like a good idea, I like it. but would the party actually pick the Invisible Item Up??
Re: On click with left Mouse Button
after the hook does whatever you want it to you just finish it off with return false (for items of that name) and the item won't be picked up.
Finished Dungeons - complete mods to play
- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: On click with left Mouse Button
Thank you Komag will try my best with this Idea..
- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: On click with left Mouse Button
Hi Komag..
This is the Object I created: well Mysblade made it for me, I just tried to do something as you said..
cloneObject{
name = "Invisible_1",
baseObject = "dragon_statue",
model = "mod_assets/models/invisible_wall.fbx",
onPickUpItem = function (self,item)
playSound("level_up")
return
false
end
}
It does not work, where did I go wrong here???? Do I have to add it to my init.lua file as a onPickup???
Thxs
This is the Object I created: well Mysblade made it for me, I just tried to do something as you said..
cloneObject{
name = "Invisible_1",
baseObject = "dragon_statue",
model = "mod_assets/models/invisible_wall.fbx",
onPickUpItem = function (self,item)
playSound("level_up")
return
false
end
}
It does not work, where did I go wrong here???? Do I have to add it to my init.lua file as a onPickup???
Thxs
- Dr.Disaster
- Posts: 2876
- Joined: Wed Aug 15, 2012 11:48 am
Re: On click with left Mouse Button
- make sure you have the files referenced in the model and playSound linesIt does not work, where did I go wrong here?
- do not split commands that belong into one line like "return false"
- watch the punctuation
Code: Select all
cloneObject{
name = "Invisible_1",
baseObject = "dragon_statue",
model = "mod_assets/models/invisible_wall.fbx",
onPickUpItem = function (self,item)
playSound("level_up")
return false
end,
}- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: On click with left Mouse Button
Thxs again Doc will give it a try..
- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: On click with left Mouse Button
I have done this and it does not work.. All the files are in the right place no probs.. Do I have to add it in my init.lua file ?? I cant understand why the Object wont work.. Any other Object I add a command to does LOL..
I placed it the Dungeon clicked on it and nothing Dammm.. The invisible Object is there I run into it and it blocks me, I click on it and nothing
---- This for on touch waiting for reply ----
cloneObject{
name = "Invisible_1",
baseObject = "dragon_statue",
model = "mod_assets/models/invisible_wall.fbx",
onPickUpItem = function (self,item)
playSound("level_up")
return false
end,
}
Thxs for the help though
I placed it the Dungeon clicked on it and nothing Dammm.. The invisible Object is there I run into it and it blocks me, I click on it and nothing
---- This for on touch waiting for reply ----
cloneObject{
name = "Invisible_1",
baseObject = "dragon_statue",
model = "mod_assets/models/invisible_wall.fbx",
onPickUpItem = function (self,item)
playSound("level_up")
return false
end,
}
Thxs for the help though
Re: On click with left Mouse Button
you cannot pick up a dragon statue, make it an item, rather than an object.
Currently conspiring with many modders on the "Legends of the Northern Realms"project.
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
