Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How do i access ServerStorage?

Asked by 4 years ago

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?

0
Wowowowow. So what's your final question? You have like 10 questions in that. TheRealPotatoChips 793 — 4y
0
how else will i learn? dakanji123 97 — 4y

3 answers

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

Here are a few resources from the Roblox wiki that relate your questions.

Server Storage: https://developer.roblox.com/en-us/api-reference/class/ServerStorage

Accessing Services https://developer.roblox.com/en-us/api-reference/function/ServiceProvider/GetService

CFrames: https://developer.roblox.com/en-us/articles/Understanding-CFrame

Touched: https://developer.roblox.com/en-us/api-reference/event/BasePart/Touched

Tools https://developer.roblox.com/en-us/api-reference/class/Tool

WaitForChild: https://developer.roblox.com/en-us/api-reference/function/Instance/WaitForChild

Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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) ~~~~~~~~~~~~~~~~~

0
Should put your explanations in Block Quotes and the code in the Code Blocks. ForeverBrown 356 — 4y
Log in to vote
0
Answered by 4 years ago

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"

Answer this question