Jump to content

Project Saturn Tutorial help.


AudiDJ
 Share

Recommended Posts

So I am very interested in the Project Saturn Tutorials put on by Jorn. However, I have run into a problem and cannot find a solution. I keep getting - error in Function 'Point'. argument #2 is 'string';'Entity' expected. -Here's my script:

 

Script.player = "" --entity "Player"

Script.rotationSpeed = 0.1 --float "Rotation Speed"

Script.fireRate = 1.0 --float "Fire rate"

Script.fireRateTimer = 0

Script.muzzleFlashLight = "" --entity "Muzzle Flash Light"

Script.muzzleTime = 0.1 --float "muzzleTimer"

Script.muzzleTimer = 0

 

function Script:UpdateWorld()

self.entity:Point(self.player, 2, Time:GetSpeed() * self.rotationSpeed)

 

self.fireRateTimer = self.fireRateTimer + (Time:GetSpeed()/100)

self.muzzleTimer = self.muzzleTimer + (Time:GetSpeed()/100)

 

if(self.fireRateTimer > self.fireRate) then

self.muzzleFlashLight:Show()

self.muzzleTimer = 0

end

if(self.muzzleTimer > self.muzzleTime) then

self.muzzleFlashLight:Hide()

end

end

 

 

Thanks for taking a look.

-Audi

Link to comment
Share on other sites

Just a side note that I always set --entity default values to nil. You have it as a string for a default value which doesn't really matter most likely but you aren't expecting it to be a string you are expecting it to be an entity object

 

Script.player = nil --entity "Player"

 

After making that change you'll probably get nil value received or something like that because you probably didn't drag anything in that field from the editor? That's what Aggror is trying to get at with his post.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...