rtvr56565
(rtvr56565)
December 25, 2021, 11:00pm
#1
I’m trying to make a script that when touch a part, it prints a number, it’s very simple, but I don’t know why isn’t working…
Script (already tried LocalScript)
script.Parent.Touch.Touched:Connect(function()
print(1)
end)
The Part has CanTouch enabled, if this little information isn’t helping to know whats wrong, please say what informations should I say more.
Thanks
4 Likes
Scottifly
(Scottifly)
December 25, 2021, 11:06pm
#2
Do numbers print without quotations? I’ve never dealt with it before…
Also what does the hierarchy of the script/part/Touch in your explorer window look like?
2 Likes
rtvr56565
(rtvr56565)
December 25, 2021, 11:08pm
#3
Yes, numbers can be printed or used without quotations
2 Likes
neeXu2k19
(neex_Dev)
December 25, 2021, 11:08pm
#4
What is the ‘Touch’ object, is it basepart or some kind of other object?
Also if its located in workspace, dont try local script, because local scripts arent working in workspace.
Any errors?
Try doing repeat wait() until game:IsLoaded()
at the first line
1 Like
rtvr56565
(rtvr56565)
December 25, 2021, 11:13pm
#5
Touch is a normal part.
Yes, I forgot about Local Scripts don’t work in workspace, and I already tried on players folders and worked (but I can’t use Local Script in what I’m trying to make)
and the line u said, for some reason, stopped all the script, like the game never loaded.
I tried a normal task.wait(60)
to see if was about game load, but isn’t.
3 Likes
Sarchyx
(Sarchyx)
December 25, 2021, 11:22pm
#6
Where is the script located? It would be easier if you could provide us the hierarchy.
rtvr56565:
and the line u said, for some reason, stopped all the script, like the game never loaded.
I tried a normal task.wait(60)
to see if was about game load, but isn’t.
Place not loading is definitely not the issue, also game:IsLoaded()
and game.Loaded
do only work on LocalScripts.
2 Likes
rtvr56565
(rtvr56565)
December 25, 2021, 11:23pm
#7
The script is inside a model on workspace.
1 Like
oopacity
(die)
December 25, 2021, 11:29pm
#8
Are there any errors in the console once you run the script?
1 Like
rtvr56565
(rtvr56565)
December 25, 2021, 11:30pm
#9
No, there are no errors, I tried put the scripts with more functions to see what happend and all functions inside script works but not the Touched event
1 Like
oopacity
(die)
December 25, 2021, 11:32pm
#10
Can you show me what the model looks like inside of the explorer?
1 Like
rtvr56565
(rtvr56565)
December 25, 2021, 11:33pm
#11
Is a normal dummy model (I’m not on studio rn)
The Touch part is with a weld in Dummy Head
1 Like
Cbrrah
(Cbrah)
December 25, 2021, 11:42pm
#12
What is the parent of the script?
1 Like
Roastdbacon
(Roastdbacon)
December 25, 2021, 11:50pm
#13
is the part cancollide off? cuz if it is turn on
1 Like
notMundaze
(cookdaze)
December 26, 2021, 12:41am
#14
what is “touch”, a part inside a script is unusual and only parts, unions and meshparts have the touched property
1 Like
Scottifly
(Scottifly)
December 26, 2021, 3:16am
#15
When you play in Studio test mode when you select the dummy’s head does it have CanTouch true?
1 Like
Seems to be working perfectly fine for me! Try using the .rblx
file below, tell me if it’s working for you!
model thing lol.rbxm (3.2 KB)
1 Like
rtvr56565
(rtvr56565)
December 26, 2021, 2:14pm
#17
Yes, the CanTouch is enabled in testing
1 Like
rtvr56565
(rtvr56565)
December 26, 2021, 2:15pm
#18
touch part is inside a Dummy Model, welded in Head,the script is on Dummy Model
@Cbrrah
1 Like
rtvr56565
(rtvr56565)
December 26, 2021, 2:16pm
#19
It can’t be CanCollide on, but if I put on, is the same thing, it doesn’t work
1 Like
Cbrrah
(Cbrah)
December 26, 2021, 10:16pm
#20
Would you mind sending a screenshot of your workspace?
1 Like