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

trying to make a script but keeps saying connect is not valid member of part anyone know?

local Gamepass = 122313

local Player = game.Players.LocalPlayer

function onTouched(m) p = m.Parent:findFirstChild("Humanoid") if p ~= nil and game.MarketplaceService:PlayerOwnsAsset(Player,Gamepass) then p.LowerTorso.CFrame = CFrame.new(0,8,9) end end script.Parent:connect(onTouched)

1 comment

0

Can you correctly put your code in a code block please?

1 answer

✓ Accepted answer

You are trying to call "connect" on an instance, not an event.

Instead of:

script.Parent:connect(onTouched)

do

script.Parent.PUT_EVENT_CALL_HERE:connect(onTouched)

-- For example:
-- script.Parent.OnServerEvent:connect(onTouched) (if RemoteEvent in a Server Script)

2 comments

0

My apologies, meant "PUT_EVENT_LISTENER_HERE".

0

exuse me but im not that advanced on scripting so im not sure what to put as a listener

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