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

How do i access ServerStorage?

How do i access ServerStorage? How does Cframe work? How does Player touching something work? How does player equip work?

If i were to say game:WaitForChild("workspace), how do i go to the next thing? I can't just go game:WaitForChild("workspace").part?

3 comments

0

Wowowowow. So what's your final question? You have like 10 questions in that.

0

how else will i learn?

3 answers

✓ Accepted answer

To access ServerStorage, Workspace , etc. Use the word

:GetService()
Example:

game:GetService("Workspace")

or

game:GetService("ServerStorage")


CFrame is used to re-positioned or rotate at the object/part. That's for only the basics! I will not explain the whole complicated topic

Example:

local redBlock = game:GetService("Workspace").RedBlock -- You change the position on the block redBlock.CFrame = CFrame.new(-2, 2, 4)


How does Player touching something work?
When the player touched the part, and the Humanoid was detected. The function Touched Event will run!

Example:

game.Workspace.Part54.Touched:connect(function(hit)-- Function of Touched event if hit.Parent:FindFirstChild("Humanoid") then-- if player has humanoid then print(hit.Name)-- It will print who touches the part end end)



1 comment

0

Should put your explanations in Block Quotes and the code in the Code Blocks.

Hi there. You can only access ServerStorage with a script (not a localscript).

Scrips changes server events, and localscript changes client ( or player ) events. ServerStorage has a "server" word in it, so I think scripts can only access it.

If you want to access to it from a local script, insert a remote event in replicatedStorage.For further information, go check in the Roblox dev hub "remote events"

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