Thomas_klei Posted August 1, 2019 Share Posted August 1, 2019 i'm having problems with certain conditions not working as it keeps on talking about needing a function enlargements, i'm sure this is a novice mistake but i don't understand >.< local function onread (inst,reader) local pt = reader:GetPosition() local numtentacles = 3 if reader:HasTag("frick") then for k = 1, numtentacles do local theta = math.random() * 2 * PI local radius = math.random(3, 6) reader.components.sanity:DoDelta(-TUNING.SANITY_HUGE) local result_offset = FindValidPositionByFan(theta, radius, 12, function(offset) local pos = pt + offset return #TheSim:FindEntities(pos.x, 0, pos.z, 1, nil, { "INLIMBO", "FX" }) <= 0 and TheWorld.Map:IsDeployPointClear(pos, nil, 1) end) if result_offset ~= nil then local x, z = pt.x + result_offset.x, pt.z + result_offset.z reader.components.petleash:SpawnPetAt(x, 0, z) if reader.petleash:numpet ~= 3 then ------------- # around here it starts to crash SpawnPrefab("poopcloud").Transform:SetPosition(x, 0, z) ShakeAllCameras(CAMERASHAKE.FULL, .2, .02, .25, reader, 40) end return true end end end end Link to comment https://forums.kleientertainment.com/forums/topic/109836-help-with-function-arguements/ Share on other sites More sharing options...
Serpens Posted August 1, 2019 Share Posted August 1, 2019 a ":" is always used to call a fcuntion. So you try to call numpet as a function, so it expects the brackets () of a function. Replace the ":" with a dot and you are fine Link to comment https://forums.kleientertainment.com/forums/topic/109836-help-with-function-arguements/#findComment-1237389 Share on other sites More sharing options...
Thomas_klei Posted August 1, 2019 Author Share Posted August 1, 2019 thnx Link to comment https://forums.kleientertainment.com/forums/topic/109836-help-with-function-arguements/#findComment-1237464 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now